Write a function that will merge the contents of two sorted (ascending order) arrays of type integer values, storing the result in an array output parameter (still in ascending order). The function should not assume that both its input parameter arrays are the same length but can assume that one array does not contain two copies of the same value. The result array should also contain no duplicate values.The function should receive input arrays as input arguments and output array as an output argument along with any other required arguments. Maintain two position pointers (simple integers) for the 2 input arrays. Compare elements of both arrays and increment appropriate pointer
Write a function that will merge the contents of two sorted (ascending order) arrays of type integer values, storing the result in an array output parameter (still in ascending order). The function should not assume that both its input parameter arrays are the same length but can assume that one array does not contain two copies of the same value. The result array should also contain no duplicate values.The function should receive input arrays as input arguments and output array as an output argument along with any other required arguments.
Maintain two position pointers (simple integers) for the 2 input arrays. Compare elements of both arrays and increment appropriate pointer
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images