Data Structures & Algorithms
Scheduling with Heap
Greedy task/interval picks driven by a priority queue — cooldowns, deadlines, room assignment.
- Problem 01 Task Scheduler Max-heap by remaining count; parked tasks wait in a cooldown queue.
- Problem 02 Meeting Rooms II (Heap) Sort by start; min-heap of end times; peak size = rooms needed.
- Problem 03 Maximum Beauty with Deadlines Sort by deadline, evict the least-beautiful when the heap exceeds capacity.
- Problem 04 Reorganize String Max-heap by frequency; always emit top, defer the one used last.