Assignment 6 2-4

  • Post author:
  • Post category:其他


Which one of the following is the lowest upper bound of


T(n).




T


(


n


)




for the following recursion










T


(


n


)


=


2


T


(
















n























)


+


lo

g



n




?

(4分)






设 m = logn, 则2^m = n.


T(2^m) = 2T(2^(m/2))) + m


设 G(m) = T(2^m),则原式转化为G(m) = 2G(m/2) + m


根据主定理,a = 2, b = 2, k = 1, p = 0. a = b^k,满足条件2,所以算法复杂度为O(mlogm)


又因为 m = logn,所以算法复杂度为O(logn loglogn )




附:主定理






版权声明:本文为ZJU_fish1996原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。