K-way merge

Suppose you are give k k sorted arrays each of n n elements. Using the standard merge subroutine you merge the first 2 arrays and merge the 3rd array to the already merged arrays, and so on until you merge the k k -th array, what is the running time of this procedure?

O ( n k 2 ) O(nk^{2}) O ( k 2 lg ( n ) ) O(k^{2}\lg(n)) O ( k n lg ( n ) ) O(kn\lg(n)) O ( n ) O(n)

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

0 solutions

No explanations have been posted yet. Check back later!

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...