Skip to main content

Heap / Priority Queue

Efficiently track the k-th largest/smallest element or merge sorted sequences.

9 problems 0 Easy 7 Medium 2 Hard

Problems (9)

Problem Link
Kth Largest Element in an Array
Find Median from Data Stream
Task Scheduler
Merge K Sorted Lists
K Closest Points to Origin
Reorganize String
Top K Frequent Words
Find K Pairs with Smallest Sums
Minimum Cost to Connect Sticks

Related Guide

Heap & Priority Queue Problems — Every Pattern With Examples [2026] →

The heap is the secret weapon for top-K, K closest, and merge-K problems. Here's how it works and th…

Enjoying this free content?

If this saved you time, buying me a coffee keeps new content coming.

Buy me a coffee
Buy me a coffee