Skip to content

0622-1114405019-洪翊滕 Test-4 - #1318

Open
1114405019 wants to merge 2 commits into
DevSecOpsLab-CSIE-NPU:mainfrom
1114405019:0622-4
Open

1114405019 wants to merge 2 commits into
DevSecOpsLab-CSIE-NPU:mainfrom
1114405019:0622-4

Conversation

@1114405019

Copy link
Copy Markdown

完成題號

  • 第四題:二分搜尋效能(K = 100 + 19 = 119)

執行方式

  • python search_perf.py # 無 stdin 時自動生成 m=200,000 陣列並保證 K 在其中
  • python -m pytest test_search_perf.py -v

依賴套件

  • matplotlib>=3.10
  • pytest>=8.0
    (見 requirements.txt)

補充說明

  • 開發流程:先寫 test_search_perf.py(紅燈 commit),確認測試案例後才寫 search_perf.py 實作(綠燈 commit)
  • search_perf-easy.py 為 AI 教的簡化版本,只保留 linear_search/binary_search 核心邏輯供 CPE 練習手打
  • 雷達圖維度(small-n speed / large-n speed / cmp 次數 / 是否需先排序)與正規化方式說明於 README.md
  • AI 使用紀錄見 AI_LOG.md

先寫 test_search_perf.py 涵蓋 FOUND/NOT FOUND、邊界值、單元素、
cmp 上限與 linear/binary 交叉驗證,此時尚無 search_perf.py 實作,
測試應為紅燈(ModuleNotFoundError)。
新增 search_perf.py(linear_search/binary_search/陣列生成/timeit/雷達圖串接)、
search_perf-easy.py(AI 教的簡化版,含中文註解)、plot.py、requirements.txt、
README.md、AI_LOG.md 與 test_log.txt,test_search_perf.py 12 個測試全數通過。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant