Quick Summary
- Design an incremental task scheduler that accepts dependent tasks and executes them in valid topological order.
- Support dynamic task insertion while detecting cycles and enforcing lexicographical priority for ready tasks.
- Combine a directed dependency graph with in-degree tracking and a min-heap to manage execution state efficiently.
What This Tests
- Directed graph modeling with dynamic edge insertion
- Incremental topological sorting and in-degree maintenance
- Reachability-based cycle detection
- Priority queue utilization for ordered extraction
Common Patterns
Graph Traversal
DFS/BFS
Heap / Priority Queue
Hashing
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Stdout
-