module Mark:
Parameters: |
|
val dfs : Traverse.G.t -> unit
dfs g
traverses g
in depth-first search, marking all nodes.val has_cycle : Traverse.G.t -> bool
has_cycle g
checks for a cycle in g
. Modifies the marks.
Linear time, constant space.