(Q) More information: cppreference.comΒΆ

Goal: I can find more information about STL containers and their methods.

Instructions: From cppreference.com, you can find lot of more information about C++ and STL containers. On this course, we are studying only the containers vector, set, and map. The sections concerning them can be found from the links:

You can also find the sites above by googling. If you, for example, need more information on a vector, you can use the keywords:

C++ vector

Answers to the question below can be found from the aforementioned links (and from the Plussa material). Only the aforementioned three containers will be considered in the questions.

* Method insert:

Which of the containers under consideration have method insert?

* Method erase:

Which of the containers under consideration have method erase?

* Method find:

Which of the containers under consideration have method find?

* Adding a new element in a vector:

Vector has the methods insert and push_back for adding new elements. What are the differences and similarities between these methods?

* Indexing a vector:

In indexing a vector, you can use either at method or [] operator (operator[]). What is the difference between these indexing ways?

* Indexing vs adding an element:

Also a map has the aforementioned ways to index (at and []). Is it possible to use these also for adding an element?

* Iterator invalidation:

Sometimes an iterator can become invalid. With which methods and which containers this can happen?

* Types of elements and keys:

Which types are (naturally, with no special actions) possible for the elements and keys of containers?

* Indexing a container:

Both vector and map have method at for indexing. How does this method differ in these containers?