Breadth-first search: Difference between revisions

Content deleted Content added
Ajmullen (talk | contribs)
Pseudocode: suggest to inline images, to save vertical space
Line 35:
 
=== More details ===
[[Image:MapGermanyGraph.svg|thumb|250px|center|An example map of [[Southern Germany]] with some connections between cities]]
 
[[Image:GermanyBFS.svg|thumb|250px|center |The breadth-first tree obtained when running BFS on the given map and starting in [[Frankfurt]]]]
This non-recursive implementation is similar to the non-recursive implementation of [[depth-first search]], but differs from it in two ways:
 
Line 54 ⟶ 56:
=== Example ===
 
The followinglower isdiagram an example ofshows the breadth-first tree obtained by running a BFS on an example graph of [[Germany|German]] cities (upper diagram) starting from ''Frankfurt'':.
 
[[Image:MapGermanyGraph.svg|thumb|250px|center|An example map of [[Southern Germany]] with some connections between cities]]
 
[[Image:GermanyBFS.svg|thumb|250px|center |The breadth-first tree obtained when running BFS on the given map and starting in [[Frankfurt]]]]
 
== Analysis ==