Search: | |||||

| ||||

Home » Interview FAQ » C++ Programming | RSS Feeds |

A depth first search of an arbitrary graph can be used to perform a traversal of a general graph. The strategy is as follows. A node s is picked as a start node and marked. An unmarked adjacent node to s is now selected and marked, becoming the new start node; possibly leaving the original start node with unexplored edges for the present. The search continues in the graph until the current path ends at a node with outdegree zero or at a node with all adjacent nodes already marked. Then the search returns to the last node which still has unmarked adjacent nodes and continues marking until all nodes are marked. Since adjacent nodes are needed during the traversal, the most efficient representation again is an adjacency list.

Didn't find what you were looking for?
Find more on What is DFS (Depth First Search) in dfs (data file structure)?
Or get search suggestion and latest updates.

Related Topics:

- What is BFS (Breadth First Search) in dfs (data file structure)?
- File Structure in dfs (data file structure)?
- Define file in dfs (data file structure).
- What is Sequential Search in dfs (data file structure)?
- What is Binary Search in dfs (data file structure)?
- Write an algorithm for Sequential Search in dfs (data file structure).
- Write an algorithm for Binary Search in dfs (data file structure).
- What is graph in dfs (data file structure)?
- What is garbage in dfs (data file structure)?
- What is Loop in dfs (data file structure)?
- What is Multigraph in dfs (data file structure)?
- What is Outdegree in dfs (data file structure)?
- What is Path in dfs (data file structure)?
- What is Cycle in dfs (data file structure)?
- What is Preloading in dfs (data file structure)?
- What is Linear in dfs (data file structure)?
- What is vector in dfs (data file structure)?
- What is stack in dfs (data file structure)?
- What is queue in dfs (data file structure)?
- What is Malloc in dfs (data file structure)?

- Comment should be atleast 30 Characters.
- Please put code inside [Code] your code [/Code].