Depth First Search

 Pseudo - code for Depth First Search :

DFS()
{
    for( counter = 1 ; counter <= Number Of Nodes in the graph ; counter++)
    if ( node[counter] is Unvisited)  executeDFS(counter)

}

executeDFS( nodeNumber )
{
    node[nodeNumber] = visited
    for( all nodes adjacent to node[nodeNumber] )
    if the node[currentNode] is unvisted 
    executeDFS(currentNode) ;
}


ċ
GraphsDFS.jar
(183k)
Prashant Bhattacharji,
Aug 2, 2011, 1:30 PM
Comments