binary search tress using classes

Terry Reedy tjreedy at home.com
Sun Oct 28 01:35:02 EST 2001


<christy_girl99 at yahoo.com> wrote in message
news:mailman.1004246848.30973.python-list at python.org...
> Hi,
> 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

The way to do this in Python is with a dictionary.  Without being
fancy about the definition of 'word', you need 10 lines or less for
the whole program.  I believe I've seen the code posted.  Using
classes and 'modularity' is way overkill.

Terry J. Reedy





More information about the Python-list mailing list