Back to exercises

Merge Two Sorted Arrays

Walk both arrays with two pointers, append the smaller value each step, and then append the remaining tail from whichever array is not exhausted yet.

Coding Exercises Easy O(n + m)

Merge Two Sorted Arrays

Walk both arrays with two pointers, append the smaller value each step, and then append the remaining tail from whichever array is not exhausted yet.

Merge two sorted arrays into one sorted list.