Bfs Complexity