Merging two sorted arrays into one takes .
Two pointers, one per array. Compare, take smaller, advance pointer.
Example: Merge and : : take →
: take →
: take →
: take →
: take →
Take →
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
How to merge two sorted arrays.
Merging two sorted arrays into one takes .
Two pointers, one per array. Compare, take smaller, advance pointer.
Example: Merge and : : take →
: take →
: take →
: take →
: take →
Take →