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

Alex Stapleton alexs at advfn.com
Sun Jun 5 02:02:50 CEST 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