example to traverse with BFS

DFS is much easier to implement.