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

[[]] [] [[] []] is a tree where the top node has two children, and the child has two children, And the right child has two children.

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".)


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -