BFS breadth first search is another building block algorithm. It's built from a queue and a visited marker array.
See All 282 Episodes of "Programmers Quickie"