← Back to All Algorithms

🔀 Merge Sort

How It Works (Divide & Conquer)

  1. Divide: Split array into two halves
  2. Conquer: Recursively sort each half
  3. Combine: Merge the sorted halves into one sorted array

Key Insight: Merging two sorted arrays is O(n). We do O(log n) levels of merging.

Click "Start" to begin Merge Sort

Complexity