On Sat, 20 Aug 2005 15:19:55 -0400, Roy Smith <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>,
>  [diegueus9] Diego Andrés Sanabria <[EMAIL PROTECTED]> wrote:
>
>> Hello!!!
>> 
>> I want know if python have binary trees and more?
>
> Python does not come with a tree data structure.  The basic data structures 
> in Python are lists, tuples, and dicts (hash tables).
>
> People who are used to C++'s STL often feel short-changed because there's 
> not 47 other flavors of container, but it turns out that the three Python 
> gives you are pretty useful.  Many people never find a need to look beyond 
> them.

Uh, the STL has seven flavors:
- vector
- deque
- list
- set
- map
- multimap
- multiset
so that's not too bad for a static language. Each of them
is vital for some purpose, but vector and map are by far the
most commonly used.

Neither C++ nor Python has tree structures in their standard libraries. I
assume that's because there is no single interface that is proven to suit
everybody's needs.

/Jorgen

-- 
  // Jorgen Grahn <jgrahn@       Ph'nglui mglw'nafh Cthulhu
\X/                algonet.se>   R'lyeh wgah'nagl fhtagn!
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to