bfs and dfs algorithm with example in data structure