Sorted List (binary tree) why no built-in/module?

Alex Stapleton alexs at advfn.com
Sat Jun 4 20:02:50 EDT 2005


Unless I've totally missed it, there isn't a binary tree/sorted list  
type arrangement in Python. Is there a particular reason for this?  
Sometimes it might be preferable over using a list and calling  
list.sort() all the time ;)

On a somewhat unrelated note, does anyone know how python searches  
lists when you do things list list.index(n), is it a binary search,  
or does it just scan the list?



More information about the Python-list mailing list