Correctness

Algorithm terminates because Visit only performs work on white nodes and instantly makes the visted node non-white. Thus, impossible to recurse forever.

Correctness proof by induction on the length of the constructed list.


next up previous
Next: Running Time: Standard Analysis Up: TOPOLOGICAL SORT Previous: Observations