Bloomberg LP Interview Question
Software Engineer / DevelopersTeam: Price history
Country: United States
Interview Type: In-Person
The iterators in case of vector is random_access_iterator so effectively the iterator acts like a pointer and can point to any item in the vector. On the other hand in case of list, the iterator is bidirectional_iterator.
If I understand the question correctly, if the prior links are deleted the iterators point to the begin of the vector or the list.
In the list,iterators keep their validity.
- zhangsw126 August 23, 2014In the vector,iterators before the deleted keep their validity,others are invalidated.