Question: Write a function that merges two sorted dynamic allocated array ( DAA ) , producing a new sorted DAA. Keep an index into each DAA,

Write a function that merges two sorted dynamic allocated array (DAA), producing a new sorted DAA. Keep an index into each DAA, indicating how much of it has been processed already. Each time, append the smallest unprocessed element from either DAA, then advance the index. For example,
if array a is
14916
and array b is
479911
then merge_sorted returns a new DAA,
14479991116
int* merge_sorted(int* a, int n, int* b, int m)
Note: you must use dynamically allocated array (DAA) to get credits for this problem. in 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 Programming Questions!