C++UCS301Data Structures · C++
AnalysisLinearSearchSortingTreesHeapsGraphsSpatial
Complexity Lab C++ Practice Setup Visualizer
Back to curriculum

Course section

Heaps & Priority Queues

Maintain the most urgent element efficiently with complete binary heaps and priority queues.

3 topics
01

Binary Heap

A binary heap is a complete binary tree stored compactly in an array and ordered by a min-heap or max-heap property.

ComplexityC++ implementation Worked trace
02

Priority Queue

A priority queue returns the highest- or lowest-priority item rather than the oldest item, commonly using a heap.

ComplexityC++ implementation
03

Heap Sort

Heap sort builds a max heap and repeatedly moves its root to the end while restoring the heap property.

ComplexityC++ implementation Worked trace

UCS301 Data Structures · C++17 · Year 2

Built for understanding, not memorisation · zssh.dev

Found a syllabus gap, incorrect explanation, or site issue? Visit the GitHub repository and open an issue.