Andrea Griffini wrote:
I've to admit that I also found strange that deleting the
first element from a list is not O(1) in python. My wild
guess was that the extra addition and normalization required
to have insertion in amortized O(1) and deletion in O(1) at
both ends of a random access sequence was going to have
basically a negligible cost for normal access (given the
overhead that is already present in python).

This was added to Python 2.4 as collections.deque

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

Reply via email to