Merge two sorted arrays
What is the time complexity of merging two sorted arrays of sizes and into a single sorted array?
Show hints (2)+
- The inputs are already sorted — no re-sorting needed.
- Each element is visited once by a pointer.
Answer
Reveal answer →Final answer
$O(m + n)$
Want the full step-by-step worked solution? It's part of Premium — along with a worked solution for every question in the bank.