Skip to content
BytePatterns

Heaps

Keep the most important thing on top — without sorting the rest.

Heaps progress0 / 7
  1. Heap BasicsNot sorted — just guaranteed to know its own winner.5m
  2. Heapify and SiftOne wrong value walks a single path back into place.6m
  3. Priority QueueServe by urgency, not by who shouted first.5m
  4. Top K ElementsHold k winners and let the weakest one guard the door.6m
  5. K Closest PointsKeep the k best by always evicting the current worst.6m
  6. Reorganize a StringSpend the commonest letter first, and hold it back one round.6m
  7. Task SchedulerSame greedy pick, but now the loser has to sit out a cooldown.7m

Quiz yourself: 3 questions from this module

1 / 3

In a min-heap, what is guaranteed about the value at index 0?