Graphs & Connectivity Hard
Topological Order Validation
A schedule is valid only when each task appears once, after every prerequisite, and no task is omitted.
Trace input
Bounded JSONEdit the lesson input, then build a deterministic source-linked trace.
Source scenarios
Complexity
BestΘ(V + E)
AverageΘ(V + E)
WorstΘ(V + E)
SpaceΘ(V)
Array state
Follow the active comparisons and writes.
Current operation
Trace stateReady to explore
Source behavior & common mistakes
Check the supplied ordering. This exercise validates a schedule; it does not construct a topological ordering.
- Constructing a new topological order instead of validating the supplied list.
- Accepting a schedule that omits tasks.
Algorithm code
JavaTaskScheduler.javaStep linked
The highlighted line follows the current step.
Ready to begin
Press Play to see what happens.
Detailed execution
Snapshot 1 / 1