I don't know what is the relation between m and n? I'm thinking of using something similar to the Merge Sort algorithm. So the recurrence running time of Merge Sort is T(n) = 2T(n/2) + n. So, how to I know if n/2 is less than or equal to m?
I believe the given function should be location inside the "Merge" function of the Merge Sort.(Since we're merging a sorted array) Thank you for your time.
Edited: I'm thinking if n/2 is less than or equal to m, use the "Given" function . Otherwise, use the original "Merge" function (The usual Merge for Merge Sort)
m
is a given constant,n
is the size of your input.n
may be much larger thanm
. You probably should figure out how to merge arrays of size greater thanm
. – n.m. yesterday