Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #16170
| From | Miki Tebeka <miki.tebeka@gmail.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Tree data structure with: single, double and triple children option along with AVM data at each node |
| Date | 2011-11-24 09:24 -0800 |
| Organization | http://groups.google.com |
| Message-ID | <29675595.296.1322155464662.JavaMail.geo-discussion-forums@vbjs5> (permalink) |
| References | <7548c4b6-f3f1-4f96-9a77-fcb9e0edeed0@s4g2000yqk.googlegroups.com> |
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, [])])
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Tree data structure with: single, double and triple children option along with AVM data at each node nirman longjam <nirmanlongjam@gmail.com> - 2011-11-23 19:50 -0800 Re: Tree data structure with: single, double and triple children option along with AVM data at each node Miki Tebeka <miki.tebeka@gmail.com> - 2011-11-24 09:24 -0800
csiph-web