Skip to content
AI360Xpert
Back to Patterns
9

Heap / Priority Queue

A Heap (or Priority Queue) is a specialized tree-based data structure that satisfies the heap property: the parent node is either greater than or equal to (Max Heap) or less than or equal to (Min Heap) its children. It's ideal for problems asking for the "Top K", "Kth largest/smallest", or "Median" elements.