BFS
From charlesreid1
Breadth-first search - queues
When doing BFS, use a queue.
Add the root node to the queue.
While the queue is not empty:
remove item from queue,
perform action on item,
add children to queue.
When doing BFS, use a queue.
Add the root node to the queue.
While the queue is not empty:
remove item from queue,
perform action on item,
add children to queue.