How To Implement Bfs And Dfs In Python