Stable divide-and-conquer sorting: split in halves until size 1, then perform linear merges level by level. Each element participates in log n merge passes giving deterministic O(n log n) time.
All inputs
Aux buffer
Preserves ties
Master: n log n
T(n) = 2T(n/2) + n. Master Theorem (a=2, b=2, f(n)=n) gives T(n) = Θ(n log n). Each of the log n levels performs linear merging over n total elements.
Practical tweak: switch to insertion sort on tiny subarrays to reduce overhead; bottom-up variant avoids recursion stack.
Bottom-up strategy: Iteratively merge runs of size 1,2,4,... eliminating recursion and enabling easy adaptive detection of presorted runs.
Parallelization: Higher-level splits farm out work to threads; merging can be balanced by splitting large runs at proportional ranks.