Just wondering when a element in a Vector is deleted/removed , is the
preceding elements r shifted left or it behave like a linked
list???
For both Java and C+++ ...
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group,
nice question, Vector are implemented as arrays so they are shifted unlike
linked list.
On Sat, Oct 1, 2011 at 9:34 PM, SAMMM somnath.nit...@gmail.com wrote:
Just wondering when a element in a Vector is deleted/removed , is the
preceding elements r shifted left or it behave like a linked
yes they are shifted
that's why you should use std::deque whenever that matters
http://www.cplusplus.com/reference/stl/vector/erase/
Because vectors keep an array format, erasing on positions other than
the vector end also moves all the elements after the segment erased to
their new positions,