All challenges
Multiple ChoiceBeginner 45s

deque memory layout

Which is a property of `std::deque` compared to `std::vector`?
Options
  1. 1O(1) push/pop at both ends and stable references except at erasures; not guaranteed contiguous storage.
  2. 2Guaranteed contiguous storage with O(1) random access, since it is implemented on top of a single buffer.
  3. 3O(1) insertion in the middle by design, because its blocks are linked so no element shifting is required.
  4. 4Its iterators are raw pointers, which makes them invalidate only when the underlying buffer is reallocated.

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle