Write a function that will merge the contents of two sorted


Problem

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 shouldn't assume that both of its input parameter arrays are of the same length but can assume that one array doesn't 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, don't 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++

Request for Solution File

Ask an Expert for Answer!!
Business Management: Write a function that will merge the contents of two sorted
Reference No:- TGS02780991

Expected delivery within 24 Hours