python - How to "nicely" print out a tree without node information -
I am dealing with trees where there is no information in each node, but how many children can be present in this present, I To represent them, I am using lists in Python. For example:
[]
is a tree with a node
[[] [] []]
Tree where there are three children of the top node
You can see that the last tree is very difficult to read. Is there a way to print these trees somehow easy to read? (I know that "easy" is subjective, so I appreciate any suggestions that you think can be "easy".) [[]] [] [[] []] is a tree where the top node has two children, and the child has two children, And the right child has two children.
Comments
Post a Comment