Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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], e.g. a=[ 6, 9, 12, 15, 29, 37] and b = [8, 10, 14, 25, 33, 45] b. m=n and a[n] < b[1], e.g. a =[ 2, 5, 9] and b = [12, 14, 16] a[i] refers the value in position i of file a, etc. 4. 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[n/2] < b[1] < b[m] < a[(n/2)+1], e.g. a = [2, 5, 7, 55, 61, 72] and b =[9, 15, 17, 21, 29, 46] b. m=1 and b[1] < a[1] c. m=1 and a[n] < b[1] a[i] refers the value in position i of file a, etc.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions

Question

=+what kinds of policies and practices should be developed?

Answered: 1 week ago

Question

=+ Of the HR issues mentioned in the case,

Answered: 1 week ago