Problem Statement

Given two sorted arrays arr1[] of size N and arr2[] of size M. Each array is sorted in non-decreasing order. Merge the two arrays into one sorted array in non-decreasing order without using any extra space.

Pattern: Pattern 2 values in 1 variable


Gap Solution

Also the Shell Sort intuition

 

Notes