Suppose you are given two sorted subarrays, [a[0], a[1], ..., a[n-1]] and [a[n], a[n+1], ..., a[2n]] . How will you merge the two subarrays so that [a[0], a[1], ..., a[2n-1], a[2n]] is sorted using an auxiliary array of size n (instead of 2n )?
Example- Suppose the given sorted subarrays are [10, 32, 55] and [9, 17, 28]. The algorithm works as : |