How to implement tree in Python?
I am Python beginner.
Give me a general idea!
How to implement tree in Python?
I am Python beginner.
Give me a general idea!
Build a Node class, having some content object and a list of children, which are again instances of Node.
Looking at example source code gives the best idea.
Source code from Chapter 5 Trees Problem Solving with Algorithms and Data Structures Using Python