[Python-Dev] FIFO data structure?
Sun, 20 Apr 2003 12:21:49 -0400
-----BEGIN PGP SIGNED MESSAGE-----
On Sunday 20 April 2003 06:53 am, andrew cooke wrote:
> i haven't looked at the code, but when you mention lists are you referring
> to standard python structures? i understood that the thing in python that
> looks like a list is actually an array (a simple one, not a vlist), so
> access to index elements is done in constant time.
But deleting an element from the beginning is O(n), because all the elements
have to be moved back to replace it. So queues implemented via list.append
and list.pop(0) are O(N) in dequeue.
> (the links you gave don't work for me.)
Ah, shoot, I always forget the ~fincher.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)
-----END PGP SIGNATURE-----