Question: Merge SortTEST SUITE REQUIRED (15 pts, 5 for the algorithm and 10 for the code) Write a function that will merge the contents of two

Merge SortTEST SUITE REQUIRED
(15 pts, 5 for the algorithm and 10 for the code)
Write a function that will merge the contents of two sorted arrays in ascending order (small- >large) of type double values, storing the result in an array output parameter (still in sorted ascending order). The function shouldnt assume that both of its input parameter arrays are of the same length but can assume that one array doesnt contain two copies of the same value (but the same value may be in both arrays). The result should contain no duplicate values.
In other words: The two input arrays are sorted and may be of different lengths and/or contain some of the same values, and the result array should eliminate duplicates and enforce an ascending order.
HINT: When one of the input arrays has been exhausted, dont forget to copy the remaining data in the other array into the result array.
Test your function with cases in which a) the first array is exhausted first b) the second array is exhausted first and c) the two arrays are exhausted at the same time (that is, they have the same length)
Remember that the array inputs must already be sorted.C++

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!