binary search trees using classes

Grant Edwards grante at visi.com
Mon Oct 29 12:00:23 EST 2001


In article <3BDC5B9F.32246B75 at accessforall.nl>, Ype Kingma wrote:

>> I was wondering if anyone had a binary search tree module I
>> could use? I need to write a program that counts the number of
>> occurrences of each word in a file, and outputs the word and
>> corresponding counts alphabetically. For example, if input is
>
> You might consider an alternative:
> 
> Counting words is better done using a dictionary.

Coming up with the answer to a different/better question
doesn't usually result in high grades on homework problems.

> This will use hashing for lookups, which is normally faster
> than using a binary tree.

Ah, but the whole point is to learn how binary trees work.

-- 
Grant Edwards                   grante             Yow!  Jesuit priests are
                                  at               DATING CAREER DIPLOMATS!!
                               visi.com            



More information about the Python-list mailing list