wl413911

常用算法复杂度

算法分析 主定律: Master Theorem

 

常用算法的时间复杂度

Algorithm Recurrence relationship Run time
Binary Search T(n) = T(n/2) + O(1) O(logn)
Binary Tree traversal T(n) = 2T(n/2) + O(1) O(n)
Optimal sorted matrix search T(n) = 2T(n/2) + O(logn) O(n)
Merge sort T(n) = 2T(n/2) + O(n) O(nlogn)

 

posted on 2020-05-19 10:13  wl413911  阅读(154)  评论(0编辑  收藏  举报