In C++
Define a function
int * merge (int * p1, int len1, int * p2, int len2)
that “merges” the arrays where the first array has base address p1with length len1 and the second array has base address p2 withlength len2.
Additionally, the elements of both arrays are guaranteed tobe in ascending order.
The function should return a dynamically allocated array containingall the merged elements in ascending order.
To merge, we start with the zero element of p1 or p2, whichever issmaller, followed by the next smallest element and so on
until the elements of (at least) one of the arrays areexhausted.
If there are still elements
PayPal Gateway not configured
PayPal Gateway not configured