You are on page 1of 3

ASSIGNMENT:8

DATE:12.07.21
1.DFS in tree:
DFS in graph:
2.Depth First Traversal for a graph is similar to Depth First Traversal of a tree. The only
catch here is, unlike trees, graphs may contain cycles, a node may be visited
twice. To avoid processing a node more than once, use a Boolean visited
array. The one thing it is similar to it is we are using traversal part to append the
items from the selected part.

You might also like