Jan 12, 2009

What are vector, list, deque and their differences?

What are vector, list, deque and their differences?

Vector: The internal nature of a vector is dynamic array (random access)
Deques: deques are very similar to vector, except that the underlying dynamic array is open at both ends for a deque. Because of this differences, deque is fast for insertions and deletions at both ends.
List: list is quite different from vector and deque, and it manages its elements as doubly linked list. The results are the following. A list does not provide random access. Deletion and insertion takes constant time at any position.

No comments:

Post a Comment