Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
courses:cs211:winter2012:journals:jeanpaul:chapterthreesectionii [2012/01/31 00:12] mugabejcourses:cs211:winter2012:journals:jeanpaul:chapterthreesectionii [2012/01/31 00:17] mugabej
Line 20: Line 20:
 R* = set of connected components (a set of sets)\\ R* = set of connected components (a set of sets)\\
 while there is a node that does not belong to R*\\ while there is a node that does not belong to R*\\
-select s not in R*\\ +>>>>>select s not in R*\\ 
-R = {s}\\ +>>>>>R = {s}\\ 
-while there is an edge (u,v) where u∋R and v∉R\\ +>>>>>while there is an edge (u,v) where u∋R and v∉R\\ 
-add v to R\\ +>>>>>>>>>>add v to R\\ 
-end while\\ +>>>>>end while\\ 
-Add R to R*\\+>>>>>Add R to R*\\
 end while\\ end while\\
 +
 +The R produced at the end of the algorithm is the //connected component of G containing s//. The BFS algorithms is usually used when we need to order nodes we visit in successive layers based on their distance from s.\\
 +===Depth-First Search===
  
courses/cs211/winter2012/journals/jeanpaul/chapterthreesectionii.txt · Last modified: 2012/01/31 01:40 by mugabej
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0