







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








func DepthFirstSearch(graph G, vertex v) foreach vertex w in G do Encountered(w) = false RecursiveDFS(v) func RecursiveDFS(vertex v) Encountered(v) = true PreVisit(v) foreach neighbor w of v do if not Encountered(w) then RecursiveDFS(w) PostVisit(v)