Question: I can provide more information if needed. Problem 7.13. The use of sentinels in algorithm merge requires the availability of an additional cell in the

 I can provide more information if needed. Problem 7.13. The use

of sentinels in algorithm merge requires the availability of an additional cell

in the arrays to be merged; see Section 7.4.1. Although this is

I can provide more information if needed.

Problem 7.13. The use of sentinels in algorithm merge requires the availability of an additional cell in the arrays to be merged; see Section 7.4.1. Although this is not an issue when merge is used within mergesort, it can be a nuisance in other applications. More importantly, our merging algorithm can fail if it is not possible to guarantee that the sentinels are strictly greater than any possible value in the arrays to be merged. (a) Give an example of arrays U and v that are sorted but where the result of merge (U,V,T) is not what it should be. What is the contents of T after this pathological call? You are allowed the value co in arrays U and V and you may wish to specify the values of U and V outside the bounds of the arrays.) (b) Give a procedure for merging that does not use sentinels. Your algorithm must work correctly in linear time provided the arrays U and V are sorted prior to the call

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!