Saying that Java is nice because it works on all OSes is like saying that anal sex is nice because it works on all genders. Alanna

Depth-first recursive search in a tree

Language Java | Level Intermediate | Category Algorithms | August 3, 2015 9:48 pm

Algorithm Problem Description

Graph and tree nodes can be traversed using the backtracking technique. Depth-first search (DFS) is an algorithm for traversing or searching tree or graph data structures. DFS takes less memory compare than Breadth-first search and not necessary to store all of the child pointers at each level.

DFS technique used in web-crawling, Finding connected components, Topological sorting, Finding the bridges of a graph, Finding strongly connected components, Solving puzzles with only one solution, such as mazes, maze generation may use a randomized depth-first search, Finding connectivity in graphs.



Visits from source to destination using DFS: A->B->C->D->E



Please login to add comments.