tags:

views:

175

answers:

2

How to implement tree in Python?

I am Python beginner.

Give me a general idea!

+2  A: 

Build a Node class, having some content object and a list of children, which are again instances of Node.

jellybean
+3  A: 

Looking at example source code gives the best idea.

Source code from Chapter 5 Trees Problem Solving with Algorithms and Data Structures Using Python

TheMachineCharmer