depth first serch

depth first serch - for each Vertex w adjacent to v...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//initially v.visted=false for every v, couter=0 public void dfs(Vertex v) { v.num=counter++; v.visited=true;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: for each Vertex w adjacent to v if(!w.visited) { w.parent = v; dfs(w); } }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online