Writing nested dictionary (forest) of a huge depth to a text file in BFS style
问题 Continued to my older question: Writing nested dictionary (forest) of a huge depth to a text file Now I want to write the forest traversal in the BFS style: I have a huge depth dictionary that represents forest (many non-binary trees) which I want to process the forest and create a text file with the sequences of (father, son) relations from the forest, i.e. given the dictionary: {'a': {'b': {'c': {'x': {}}, 'd': {'p': {}}}, 'g': {}, 'f': {}}, 't': {'r': {'o': {}}, 'y': {}}} the generated