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

This note was uploaded on 02/18/2011 for the course 22C 031 taught by Professor Kasturi during the Spring '11 term at University of Iowa.

Ask a homework question - tutors are online