CZ
CalcyZone
computer-science Verified Precision Tool

Merge Sort Visualizer

Interactive divide and conquer Merge Sort step generator showing array splitting and merging.

Interactive Algorithm Visualizer

Merge Sort

Enter your custom input data → Run the real algorithm engine → Observe step transitions.

⚙️ Customize Algorithm Input Data

Step 1 of 8⚡ Algorithm Running
WHAT HAPPENED?

Initial array for Merge Sort.

WHY?

Algorithm state rule requirement

WHAT CHANGED?

State pointers updated

64
[0]
25
[1]
12
[2]
22
[3]
11
[4]

Mathematical Formula

T(n) = 2T(n/2) + O(n)

Overview & Explanation

Merge Sort is an O(n log n) comparison-based sorting algorithm that divides input into equal halves, sorts them recursively, and merges the sorted halves.

How It Works

  • Divide array into two halves.
  • Recursively sort each half.
  • Merge the two sorted halves.

Practical Applications

  • External sorting of huge datasets
  • Linked list sorting

Merge Step Example

Merging halves [27, 38, 43] and [3, 9, 10, 82]

1

Merge

Combine sorted halves

= [3, 9, 10, 27, 38, 43, 82]

Frequently Asked Questions

Is Merge Sort stable?
Yes, standard Merge Sort is stable.