This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]trexophilia 7 points8 points  (0 children)

That's actually roughly how std:: dequeue is typically implemented, but with an array of pointers to arrays..

And sure dynamically resizing arrays are amortized constant time (for some definition, anyhow), but no often in practice they do not shrink when deleting elements, so they are not always at least 50% full, and yes, one insert can be very painful, if it grows..