Skip to content

Instantly share code, notes, and snippets.

@fortierq
Created September 22, 2022 07:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fortierq/9cdc58fc0ee1166330f67b10593a05aa to your computer and use it in GitHub Desktop.
Save fortierq/9cdc58fc0ee1166330f67b10593a05aa to your computer and use it in GitHub Desktop.
qcm_graph1
let dfs g r =
let n = Array.length g in
let seen = Array.make n false in
let rec aux v =
if not seen.(v) then (
seen.(v) <- true;
Printf.printf "Sommet %d visité\n%!" v;
List.iter aux g.(v)
) in
aux r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment