deque vs list: performance notes

Russell Turpin noone at do.not.use
Sat Jun 3 11:55:14 EDT 2000


Christian Tismer wrote:
> Please note that there is an alternative to using doubly linked
> lists ..

My miscommunication. When I said deque, I didn't mean linked
lists, but just a vector that is allocated with spare space 
at both ends, at least whenever elements are added to or 
removed from the start. There's really no reason to copy or
reallocate a vector, every time the first element is 
deleted or inserted.  I think vector is the clear choice
over linked list as a default implementation; but I still 
want to be able to add and remove from both ends efficiently. 

Beating-a-dead-horsing-ly yrs,
Russell



More information about the Python-list mailing list