2014年8月28日

hash function 3种方法 1不好 2一般 3好

摘要: 1. h(k) = k mod m its is really bad in thepractical. if m = even and k is all even....( m is size of hash table, modulo['mɔdjuləu)2. multiplication m... 阅读全文

posted @ 2014-08-28 06:30 brave_bo 阅读(278) 评论(0) 推荐(0)

radix sort

摘要: (radix sort)Problem StatementGiven an integer array of length N, containing values in the range 1,2,3…N^2. Sort the array in O(N) time.//http://www.ge... 阅读全文

posted @ 2014-08-28 04:15 brave_bo 阅读(152) 评论(0) 推荐(0)

array linkedlist in divide and ..

摘要: array can do something right . shifting ...not good.linkedlist good in shifting but access not good. 阅读全文

posted @ 2014-08-28 03:12 brave_bo 阅读(116) 评论(0) 推荐(0)

Fibonacci 引出的关于递归时间复杂度

摘要: FinonacciT(N) = T(N-1) + T(N-2);>= 2T(N-2) = O(2^(N/2))Memorized Dp algorithm//1,1,2,3,5,8.....Memo = {}fib(n): if n in memo, return memo{n} if n<... 阅读全文

posted @ 2014-08-28 03:11 brave_bo 阅读(389) 评论(0) 推荐(0)

导航