Home > database >  It is not hard to algorithm analysis questions
It is not hard to algorithm analysis questions

Time:09-19

Suppose you have k is sorted arrays, each array contains n elements, we need to put them into a contain kn element array, one approach is to repeatedly use the Merge subroutine, first before merging two arrays, then the array and the third number combination and merged, and then merged with the fourth array, so on next, merged until the first k input array, this continuous merging algorithm (as a function of k and n) running time is what?
(a) n the log k
(b) nk
(c) nk log k
(d) nk log n
(e) nk2
(f) n2k
  • Related