Create BFS tree