Created
September 22, 2022 07:14
-
-
Save fortierq/9cdc58fc0ee1166330f67b10593a05aa to your computer and use it in GitHub Desktop.
qcm_graph1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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