Tree data structure with: single, double and triple children option along with AVM data at each node

Miki Tebeka miki.tebeka at gmail.com
Thu Nov 24 12:24:24 EST 2011


There a many ways to do this, here's one:

from collections import namedtuple
Tree = namedtuple('Tree', ['feature', 'children'])
t = Tree(1, [Tree('hello', []), Tree(3, [])])



More information about the Python-list mailing list