<div dir="auto">What would be the disadvantage of implementing collections.deque as a circular array (rather than a doubly linked list of blocks)? My naive thinking was that a circular array <font face="sans-serif">would maintain the current O(1) </font>append/pop from either side, and would improve index lookup in the middle from O(n) to O(1). What am I missing?<div dir="auto"><br></div><div dir="auto">The insertion/removal of an arbitrary item specified by a pointer would increase from constant time to linear, but since we don't have pointers this is a moot point.</div><div dir="auto"><br></div><div dir="auto">Of course when the circular array is full, it will need to be reallocated, but the amortized cost of that is still O(1). (Moreover, for a bounded deque, there's even an option of preallocation, which would completely eliminate reallocations.)<br><div dir="auto"><div dir="auto"><br></div><div dir="auto">Thanks</div><div dir="auto"><br></div><div dir="auto">Max</div></div></div></div>