So we now have a pretty good idea about what is recursion.
This means that we are ready to learn about the DFS.
Now DFS or Defi's Surge is a blind search algorithm that starts at any node and goes as far as possible
in a specific row and then backtracks until it finds a different route.
Now, this will continue until the gold node has been found or all node has been visited in a maze.
This amounts to going as far as possible in a specific part, until that path leads to a dead end.
And then backtracking and finding a new but.
Let's see how this pans out.
Example scenario.
Now suppose your Goku and your powers are gone and the only way forward is through the maze.
So the defenses that keep going on, the way you're going onto that path leads to a dead end.
So you do exactly that and encounter three in points.
One.
Do.
Three.
Until finally you encounter a dead end.
So you will have to backtrack to previous interest points and find a new route.
So you do that.
One, do you encounter a new route and then follow along the route?
Now, this procedure will continue until you find the Google note.
This means that you have found the Google note and you're free.
So the algorithm has ended.
Let us now look at a few notable characteristics of the DFS.
The number one is that a deficit is complete.
So if the graph has no cycles, so the DFS will definitely find a path.
Number two, it is not optimal.
This is because the cost of finding the solution is high as it is a blind search algorithm and finally
it is implemented using stick to keep track of all the visited nodes for backtracking later in last
in first out order.