P
Peter Ammon
According to SGI's STL reference, a deque:
Supports amortized constant time random access (like a vector)
Allows amortized constant time insertions at the beginning and end
One way you could implement this would be to allocate a chunk of memory
and start in the middle rather than in the beginning, but then deque
would have a reserve() function. So how is deque usually implemented?
Thanks,
-Peter
Supports amortized constant time random access (like a vector)
Allows amortized constant time insertions at the beginning and end
One way you could implement this would be to allocate a chunk of memory
and start in the middle rather than in the beginning, but then deque
would have a reserve() function. So how is deque usually implemented?
Thanks,
-Peter