Priority Queue → see Heap

Trees & HeapsPriority 2 of 5 — Niche — read once, revisit only if a company is known to askNicheredirect Updated Nov 12, 2026

Scope — Redirect only. This file has been merged into heap.md; it exists to point old links at the right sections. See also: heap.md — the canonical doc for heaps and priority queues.

This file has been merged into heap.md.

A priority queue is the abstract data type; a binary heap is how it is implemented. Keeping them in two files meant the same problems (LC 215, 23, 253, 295, 347, 378, 621, 703, 373) were solved twice, once per language. heap.md now holds both sides.

Where things went

You were looking for Now in
PQ problem patterns 1–8 heap.md → Problem Categories
Java PriorityQueue templates 1–12 heap.md → Templates & Algorithms — paired with the Python templates
Python heapq templates heap.md → the pattern cards
PriorityQueue API / peek without popping heap_language_apis.md — the full API reference; heap.md → Language APIs keeps the one-screen table
Classic LC problems, filed by template heap_examples.md → Index
PQ pattern → problem mapping heap.md → Decision Table
Window max and min under a limit (LC 1438) heap.md → Template 5: Two Heaps with Index Expiry — two heaps + lazy deletion, both shrink forms; the O(N) two-deque version is monotonic_queue.md → Template 7
Greedy + PQ scheduling (LC 1353 Max Events, and why the LC 253 sweep does not transfer) scanning_line_examples.md → LC 1353 — core idea, pattern table, similar LC; heap.md → Pattern 5 for the one-line signature

See also