先學課程
-概率論
運行時間(running time)
- 輸入(eg 已經排序)
- 輸入規模(6和6*10^9)
各種各樣的分析:
- 最壞情況分析(worst case)usually
? ?T(n) = max time ? when input =n
- 平均情況(average-case)sometimes
? ?T(n) = expected time over,應該是期望
? ? 為了求出概率必須做出假設(assumption)
-最好情況分析(best-case)bogus 假象
? ?cheat
what is the sort worst-case time
-計算機:
相對速度(同一機器)
絕對速度(不同機器)
漸進符號
theta -notation :舍棄低階常常量
3*n^3 + 90*n^2 -5n ?= theta(n^3)