Breadth-first search: Difference between revisions

Content deleted Content added
Dcoetzee (talk | contribs)
-wikicode
Folletto (talk | contribs)
Line 21:
 
'''function''' breadthFirstSearch (Start, Goal) {
pushenqueue(Queue,Start)
'''while''' notEmpty(Queue)) {
Node := popdequeue(Queue)
'''if''' Node = Goal {
return Node
Line 30:
'''if''' notVisited(Child) {
setVisited(Child)
pushenqueue(Queue, Child)
}
}