Min-heap
A min-heap is a heap-ordered tree in which each parent has no greater priority than its children, so a minimum-priority element is at the root.
Advanced Algorithms and Data Structures
A min-heap is a heap in which each parent has priority at most as high as that of its children, placing a minimum-priority element at the root.
- How it is used
- Uses smallest-priority retrieval for priority queues, top-k selection, and Huffman tree construction.
- How deep it goes
- Explains ordering choices and applications, but defers detailed heap operations and implementation mechanics.
- Examples
- Uses task tuples, age negation, bounded top-k retention, and frequency-weighted Huffman nodes.
- What you can do after
- Apply it via a priority queue to retrieve minimum priorities and maintain a bounded set of largest values.
Read how Advanced Algorithms and Data Structures explains min-heap →
Grokking Data Structures
A min-heap is a heap in which every parent has a value no larger than its children, so the root contains the smallest element.
- How it is used
- Uses a min-heap to extract small elements or maintain the best k candidates during a scan.
- How deep it goes
- Defines parent–child ordering, explains priority inversion, and applies the structure to bounded selection without detailing heap implementation.
- Examples
- Demonstrates six-largest selection from lottery-frequency entries using a Python heap and a custom priority function.
- What you can do after
- Apply a min-heap to extract small elements and solve top-k selection with bounded additional space.
Related concepts
- heapkind of · A binary heap is an almost complete binary tree in which each parent satisfies an ordering property relative to its children, enabling efficient access to a minimum or maximum element.
- max heapcontrasts with · A max heap is a heap-ordered data structure in which each parent is no smaller than its children, making a maximum element available at the root.
- top-kused by · Top-k is a selection method that identifies or retains up to k items ranked highest according to a specified criterion.
- priority queueused by · A priority queue is an abstract data type that retrieves or removes elements according to assigned priority rather than insertion order.
- shared memoryuses · Shared memory is a memory region or storage area accessible to multiple processes, threads, or other execution components for accessing or exchanging data.
- root nodehas part · A root node is the designated starting node of a rooted tree or hierarchy, with no parent within that structure.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

