Merge Sort Visualization

Divide & Conquer Algorithm with Binary Tree Representation

Speed: 5x
Current Step:
Click "Start Sorting" to begin the merge sort visualization.

How Merge Sort Works

Merge Sort is a divide and conquer algorithm that:

  1. Divides the input array into two halves
  2. Recursively sorts the two halves
  3. Merges the sorted halves to produce the final sorted array

The binary tree visualization shows how the array is divided into smaller subarrays until each subarray contains only one element (which is inherently sorted). Then, the subarrays are merged back together in a sorted manner.

Time Complexity: O(n log n) - making it efficient for large datasets.