Determine the number of comparisons

Determine the number of comparisons (as a function of n and m) that are performed in merging two ordered files a and b of sizes n and m, respectively, by the merge method presented in the lecture, on each of the following sets of ordered files:

a. m=n and a[i] < b[i] < a[i+1]
b. m=n and a[n] < b[1] a[i] refers the
value in position i of file a, etc.

Leave a Reply

Your email address will not be published. Required fields are marked *