Suppose I have a std container that has a total of hundred elements in it. I then removed the 50th element from the container.My questions are as follows
1-If the container is a `std::vector` what iterators will become invalidated.
2-If the container is a `std::list` what iterators will become invalidated.
3-If the container is a `std::deque` what iterators will become invalidated.
4-If the container is a `std::map` what iterators will become invalidated.
Here are the answers according to my understanding please correct me if I am wrong
1-If the 50th element is removed in a vector all the next elements will move one step up since a vector is a dynamic array and its contiguous. So iterators before 50th index would be valid and iterators greater than or equal to 50 would be invalidated after the remove
2-If the container is a list (double link list) and 50th index is removed only the iterators after or equal to the 50th index would be affected.
3-If the container is a deque I am not sure which iterators would get invalidated
4-if the container is a map I believe all the iterators would get invalidated.
(0-100) since reordering/sorting would be required. please correct me if I am wrong.