Depth First Search (DFS) is an algorithm for traversing a graph or a tree(any acyclic connected graph is a tree). We start at a starting node, traverse on a single path in the graph, backtrack when the path ends and again traverse non-visited paths while backtracking. DFS has the following…

Continue reading

0