C++, BFS, Algorithms, CS106B