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
Which sorting algorithms does not have a worst case running time of  O (n 2 ) ? Merge sort

By taking an appropriate example explain how a general tree can be represented as a Binary Tree.                                                                    C onversio

Q. Illustrate the steps for converting the infix expression into the postfix expression   for the given expression  (a + b)∗ (c + d)/(e + f ) ↑ g .

One of the main problems with the linear queue is the lack of appropriate utilization of space. Assume that the queue can store 100 elements & the complete queue is full. Thus, it

State about the Bit String Carrier set of the Bit String ADT is the set of all finite sequences of bits, including empty strings of bits, which we denote λ. This set is {λ, 0

The process of accessing data stored in a serial access memory is same to manipulating data on a By using stack  method.

Best - Fit Method: - This method obtains the smallest free block whose  size is greater than or equal to get such a block by traversing the whole free list follows.

A B-tree of minimum degree t can maximum pointers in a node T pointers in a node.

write an algorithm to delete an element x from binary search with time complex

Q. Compare and contrast various sorting techniques or methods with respect to the memory space and the computing time.