merge two sorted arrays in-place in ascending order. Eg:
A[]=7,15,21
B[]=5,12
Output
A[]=5,7,12
B[]=15,21
You can't take any extra memory space except few variables.
merge two sorted arrays in-place in ascending order. Eg:
A[]=7,15,21
B[]=5,12
Output
A[]=5,7,12
B[]=15,21
You can't take any extra memory space except few variables.
You might want to check In-place merge of two arrays) and http://www.dcs.kcl.ac.uk/technical-reports/papers/TR-04-05.pdf. How to merge two sorted arrays into a sorted array? is a simpler version of it.