Top-Down Merge Sort
Split recursively to single values, then merge sorted halves while the call stack exposes divide and conquer.
Core idea
Recursively split an interval until each leaf contains one value. On the return path, merge two sorted halves into an auxiliary buffer and copy the result back.
Read the visualization
The interval stack shows the active recursive frame. During a merge, two read pointers choose the next value, an auxiliary pointer fills the buffer, and write-back restores the source interval.
Split the current interval into two smaller recursive problems.
Complexity and tradeoffs
Time: O(n log n). Space: O(n). Stable with predictable work; recursion adds O(log n) stack frames beside the merge buffer.
Where it fits
Top-down Merge Sort gives stable, predictable performance and adapts naturally to linked lists and external sorting. Arrays pay for an auxiliary buffer and recursive frames.