dsa2 min read
Task Scheduler
Find minimum CPU intervals to schedule tasks with cooldown using a greedy max-heap simulation.
Read →
1575 articles
Find minimum CPU intervals to schedule tasks with cooldown using a greedy max-heap simulation.
Rearrange a string so no two adjacent characters are the same using a greedy max-heap approach.
Maintain a dynamic median using two heaps: a max-heap for the lower half and a min-heap for the upper half.
Compute medians of all sliding windows using two heaps with lazy deletion for element removal.
Merge K sorted linked lists into one sorted list using a min-heap to always extract the globally smallest node.