Dfs Algorithm Geeksforgeeks Python Dictionary Update