Developer

This experience deserves a bigger screen

The DSA Visualizer is designed for deep focus,
side-by-side code, and real-time execution insight.

On small screens, that level of clarity can't be preserved.

Open on a tablet (landscape) or desktop for the intended experience.

Desktop experience preview

Heap SortStep-by-Step Visualization

Heap sort is a comparison-based sorting technique based on Binary Heap data structure.

Problem Statement

Sort an array of integers using Heap Sort.

Approach

Build a Max Heap from the input data. The largest item is stored at the root. Replace it with the last item of the heap followed by reducing the size of heap by 1. Heapify the root of the tree. Repeat until heap size is 1.

Time & Space Complexity

Time complexity is O(n log n). Space complexity is O(1).

Interactive Visualization

Loading Interactive Visualizer...

Click "Play" or use arrow keys to step through the execution.