Best structure for (binary) trees?

Alan Kennedy alanmk at hotmail.com
Sun Dec 7 11:37:18 EST 2003


[Rasmus]
> As partly novice in python I would like a piece of advise of how to
> implement (binary) trees the best way?

The original Python Enhancement Proposal (PEP) for Generators (a
recently introduced feature of the python language), PEP-255, contains
a nice example of building and navigating binary trees.

http://www.python.org/peps/pep-0255.html

Search for the text "binary tree class" on that page. That should give
you sufficient sample code to play with. 

If you're able to follow the generator/yield -based examples, I'd be
so bold as to say that that is "the best way".

regards,

-- 
alan kennedy
------------------------------------------------------
check http headers here: http://xhaus.com/headers
email alan:              http://xhaus.com/contact/alan




More information about the Python-list mailing list