Pls Help! Need binary search tree module

Fredrik Lundh fredrik at pythonware.com
Sun Feb 18 16:51:12 EST 2001


Steve Mak wrote:
> I was wondering if anyone had a simple 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. And it is required that one of the data structure is a
> binary search tree.

are you sure your teacher doesn't read comp.lang.python?

I'm pretty sure you'll learn more if you do it yourself, but you
could take a look at the bisect.py module (it's in Python's Lib
directory).

Cheers /F





More information about the Python-list mailing list