In this lesson, we will look at the containers and iterators, and start with a standard vector. The vector is an answer to an atrial problems with C and C++ arrays. Namely, the number of elements that may need to distort in the container is not fixed and is also may not be known upfront. So you cannot allocate the exact number of elements in the array, but the elements will need to be accessible in the most efficient manner. Here, enter the standard vector. Let's look at the example. In this example we have three vectors being constructed. One is a default with no size, one with size but no elements, and the third using the standard race initialization. This will construct a vector in place with the values that are set in the list. Now let's build the example and run it. First let's look at the element, adding an element of the vector using the method pushback. As you can imagine the element adds via pushback is allocated and added at the end of the vector, increasing the size of the vector and making the element available. And this is exactly what we see in the output of this program. In second case, let's comment it out and use test vector two, build and run. And with test vector two, we see that the initial size of the vector is 10. And then we can actually set the element using square bracket or the referencing operator. We can actually set the element zero to value 15. And this is what we see in the output of the second line for test vector two. The last users that we will be talking about is how to access the element of the vector. There's actually two examples of how this is done. The first example uses something similar for each, which is basically the for loop that is moving through the values inside the vector, and then outputs their values. In the fourth way, we will see we will be using indices. So now let's build it. And we also get a warning. The warning here sounds from the fact that I'm declaring variable i as an integer, which is assigned type, but the size does not need to go into the negative territory. So the value for the size, the return type of the size is actually size type, which is usually unsigned, but we can you use the same size type instead of the int and we can do it, like this. Using the size type, size type is actually declared type within a vector template to define like which type is being used as a size type within this vector. And usually it's a size_t. But let's build this, and let's run it. And as you can see, initial size of the vector is 10, which is one, two, three, four, five, six, seven, eight, nine, 10. And the values are one, two, three, four, five, six, seven, eight, nine, 10, either using the value iteration or using the index. There are other ways and methods of accessing and using vectors but those are beyond the scope of this particular section, although I should point out that because vector is an extension of the functionality of the array, memory allocated for the vector is contiguous allowing for great speed of access of data, but comes with drawbacks when it comes to allocated and deallocated memory. Because the memory for the vector has to be contiguous, allocated memory during calls like pushback or in plays back could get expensive if the memory needed to append may not be available directly at the end of the vector. And the entire vector may need to shift from its original location to the new one. And if the number of elements is small, it may not be impact that much, but if the number of elements is large, then move could get expensive. Similar thing will happen when you erase the vector. Because the contents have to be contiguous, all the elements behind the erased element will have to shift forward, incurring the time expenses. There are ways to get around the first problem, but there is no way to easily get around the second. So with that in mind, let's look at the queue.