Merge Sort

Recursively splits the array in half, sorts each half, then merges them — guaranteed O(n log n).

Intermediatedivide & conquerstableO(n log n)not in-place
Loading visualization…