bfs and dfs algorithm with example pdf