問題詳情

38. Professor Chen uses the following algorithm for merging k sorted lists, each having n/k elements. He takesthe first list and merges it with the second list using a linear-time algorithm for merging two sorted lists,such as the merging algorithm used in merge sort. Then, he merges the resulting list of 2n/k elements withthe third list, merges the list of 3n/k elements that results with the fourth list, and so forth, until she endsup with a single sorted list of all elements. What is the worst-case running time of the professor Chen'salgorithm in terms of n and k.
(A)θ(log(nk))
(B)θ(nk)
(C)θ(nlogk)
(D)θ(lognlogk)
(E)θ(n)

參考答案

答案:[無官方正解]
難度:計算中-1
書單:沒有書單,新增