Binary Heap
AlgorithmsEasyInteract with Min/Max heaps, monitoring point insertions and bubble swap steps.
Alt+Shift+H
Configuration Panel
Heap Mode
Binary Heap Visualizer
Double-click empty canvas to create root, select node to add child or delete.
1D Array Representation:
[0]10
[1]15
[2]30
[3]40
[4]50
[5]60
Time Complexity
O(log N) operations / O(1) top access
Auxiliary Space Complexity
O(N) contiguous space
Conceptual Overview
A Binary Heap is a complete binary tree that satisfies the heap property: in a Min Heap, each node's value is greater than or equal to its parent's value; in a Max Heap, each node's value is less than or equal to its parent's value.
Algorithm Mechanism
Supports fast access to the minimum (or maximum) element in O(1). Node additions append to the bottom right and bubble up; root extractions replace the root with the last element and bubble down.
Source: CP-Algorithms reference guide