Question: Question 3 [20 points] Suppose you are given k sorted arrays, each with n elements, and you want to combine them into a single array
Question 3 [20 points] Suppose you are given k sorted arrays, each with n elements, and you want to combine them into a single array of kn elements. Our approach is to use the linear time Merge subroutine [O(n) runtime] repeatedly, first merging the first two arrays, then merging the result with the third array, then with the fourth array, and so on until you merge in the k-th and the final input array. What is the running time taken by this successive merging algorithm, as a function of k and n, ignoring constant factors and lower-order terms.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
