Course Schedule, traced one step at a time

examples
solution
CALL
1 / 1

Code

The highlighted line runs next. The pill shows the live values at that moment.

Course graph

An arrow b → a means take b before a

Call stack

Variables

Time and space complexity

V = numCourses, E = number of prerequisite pairs. The highlighted row is the solution being traced.

Keyboard: ← → step, Space play or pause. Use up to 10 courses and 16 prerequisite pairs, written as [[a,b],…] or just a b, a b, so the graph stays readable.