You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To perform a depth-first search a tree is traversed as deep as possible from neighbour to neighbour before backtracking. What determines how deep is possible is that edges are followed, and no vertex is visited twice. Vertices that have been visited are noted and kept track of. Visited nodes are tracked can be tracked in a boolean array and a stack to push nodes onto that are meant to be visited.
DFS(G,v) ( v is the vertex where the search starts )