记录一些算法

常见算法的复杂度:

<The progmatic programmer> 中对算法的讲义是简洁的。特别是:

O() notation

  • O(1) access element in array; Hash
  • O(lgn) binary search, traveling a binary tree
  • O(n) exhaustive search, finding the max
  • O(nlogn) divide and conqure, quick sort/heapsort
  • O(n^2) selection and insertion sorts. bubble sort
  • O(c^n) traveling salesman problem, set partitioning,permutations
posted @ 2015-10-22 11:27  lebyzhao  阅读(121)  评论(0编辑  收藏  举报