Chris Rebert <c...@rebertia.com> writes:
> > Simple example usage case: Insert string into data structure in
> > sorted order if it doesn't exist, else retrieve it.
> 
> That's pretty much the bisect module in a nutshell. It manipulates a
> sorted list using binary search.

That lets you find an existing entry in log(n) time, but inserting
or deleting an entry still takes linear time.  Also, you don't
get a persistent structure in the sense of functional programming.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to