You have one array of size M+N only M elements it has rest are empty, second array of size N, merge both of them in first array.
Algorithm:
Start comparing both the arrays from last, and filling up the array with size M+N from Last, till the 2nd arrays comes to the start.
Now you have sorted larger array.
Kindly let me know if this is not clear OR you need code for this.
question text needs to be corrected.. both array contains sorted element
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks