Sample Question #87 (programming – C++)
What’s a deque in C++? What’s its advantage over vector? What’s its disadvantage?
The deque template class represents a double-ended queue, where objects can be inserted and removed from both ends. Its advantage over the vector container is inserting and removing items from the ends are much faster with a deque than with a vector. Its disadvantage is random access to elements in the middle is slower than with a vector.
Fill in your details below or click an icon to log in:
You are commenting using your WordPress.com account. ( Log Out / Change )
You are commenting using your Twitter account. ( Log Out / Change )
You are commenting using your Facebook account. ( Log Out / Change )
You are commenting using your Google+ account. ( Log Out / Change )
Connecting to %s
Notify me of new comments via email.
Notify me of new posts via email.