Heap Data Structure

Last Updated : 11 Apr, 2026

A Heap is a complete binary tree data structure that satisfies the heap property: in a min-heap, the value of each child is greater than or equal to its parent, and in a max-heap, the value of each child is less than or equal to its parent. Heaps are commonly used to implement priority queues, where the smallest (or largest) element is always at the root.


Basics

Library Implementations

Easy Problems

Medium Problems

Hard Problems

Other Types of Heaps

Quick Links:

Comment