Depth first traversal, Data Structure & Algorithms

A depth-first traversal of a tree visits a nodefirst and then recursively visits the subtrees of that node. Similarly, depth-first traversal of a graph visits a vertex and then recursively visits all the vertices adjoining to that node. The catch is that the graph may contain cycles, but the traversal must visit each vertex at most once. The solution to the problem is to keep track of the nodes that have been visited, so that the traversal does not experience the fate of infinite recursion.

 

 

Posted Date: 7/10/2012 3:36:16 AM | Location : United States







Related Discussions:- Depth first traversal, Assignment Help, Ask Question on Depth first traversal, Get Answer, Expert's Help, Depth first traversal Discussions

Write discussion on Depth first traversal
Your posts are moderated
Related Questions
red black tree construction for 4,5,6,7,8,9

Define null values.  In some cases a particular entity might not have an applicable value for an attribute or if we do not know the value of an attribute for a particular entit

find the grammar of regular expression of (a/?)(a/b)?


How does cpu''s part tming and controls generate and controls signls in computer?

what is tower of management with example

This notation bounds a function to in constant factors. We say f(n) = Θ(g(n)) if there presents positive constants n 0 , c 1 and c 2 such that to the right of n 0 the value of f

Explain about the Abstract data type Abstract data type (ADT) A set of values (the carrier set) and operations on those values

Q. Using the following given inorder and preorder traversal reconstruct a binary tree Inorder sequence is D, G, B, H, E, A, F, I, C

Merging 4 sorted files having 50, 10, 25 and 15 records will take time  O (100)