Breadth-First Search

Take a look at the wikipedia: http://en.wikipedia.org/wiki/Breadth_first_search