Vectors are a kind of sequence container. As such, their elements are ordered following a strict linear sequence.View more random threads:
- error in c++
- if this is one statement then why we are using << again and...
- Consitional Operator in C++ July 2011
- application softwares 2011
- declared one varibale char s1[10] but when i am inputing...
- Different syntax? in c++ 2011-12
- what is the function of ostream in c++ 2011
- difference between data structre and algorithm.
- How to initializing a const set?
- why we use class in C++ May 2011 ?
Sponsored Links
Vector containers are implemented as dynamic arrays; Just as regular arrays, vector containers have their elements stored in contiguous storage locations, which means that their elements can be accessed not only using iterators but also using offsets on regular pointers to elements.
But unlike regular arrays, storage in vectors is handled automatically, allowing it to be expanded and contracted as needed.
Vectors are good at:
* Accessing individual elements by their position index (constant time).
* Iterating over the elements in any order (linear time).
* Add and remove elements from its end (constant amortized time).
There are currently 1 users browsing this thread. (0 members and 1 guests)