Merge two sorted arrays in place so the first holds the smaller elements.
Unlock detailed company stats for this questionUpgrade
Given two sorted arrays, n = size of the first and m = size of the second, rearrange the elements so that all elements in array 1 are smaller than all elements in array 2 and both arrays remain sorted. Do not use inbuilt sort functions or extra space. Hard. Code it in Notepad.
Expect follow-ups like
- What if the array size is big but the elements are from a small group?
Format · 45-minute DSA round on HackerEarth over Zoom.
Also asked as · Merge two sorted arrays.
Community answers
No answers contributed by the community yet.
Related questions
Implement an in-place merge of two sorted arrays.Find the kth element in two sorted arrays.Find the k smallest elements from multiple sorted arrays.Related courses

Course

Course
Course

