← Back to Algorithms

Merge Sort

A divide-and-conquer algorithm that recursively breaks down a list into smaller sublists until each sublist consists of a single element, then merges those sublists to produce a sorted list.

Current Operation

Click 'Sort' to start visualization

Step: 0/0

Time Complexity: O(n log n)
Space Complexity: O(n)

How it Works

Step-by-Step Process:

1. Divide array into two halves

2. Recursively sort both halves

3. Merge sorted halves by comparing elements

4. Build final sorted array