The Straightforward Approach: Merge

Here are two sorted arrays. The simplest way to find the median is to merge them into one sorted array and read off the middle element. Let us see what that costs.

Merged output0/6 steps

Total elements is m + n = 11. To get the median of the merged array, how many elements do we need to process in the worst case using the straightforward merge?