In this 3rd part of the C++ Standard Template Library tutorial we pick up from our previous article on Sequence Containers that focused mostly on the Vector. This tutorial builds on that content and adds the Linked list and the Deque.
Before we jump in to discuss the Linked list and the Deque, if you missed the beginning of this programming tutorial series then you might want to go back and read on the overview of the C++ Standard Template Library.Before we take a look at the Linked List which comes in the form of a list and a forward list. We want to keep things much simpler than they already are. So we will go ahead and discuss the Deque first then come back to the Linked list.
Deque so happens to be very similar in implementation to the vector with the major difference being one. The vector grows in one direction, which is the back while the deque can grow either in the front or the back ends.
Deque also has similar In computing, an interface is a shared means by which two or more separate components of a computer system exchange information. The interface could be between the human and a computing device, two computers, computer hardware, software or peripheral devices. Examples include touch screens which allow information to be exchanged between a human and the devices, A software graphical interface,... More to the vector. It has fast inserts and removes at the beginning and the end. It comes with slow inserts and removes in the middle of the container and slow search.
Below is an example implementation of the deque in code.
Linked List (Or Simply List)
A linked list or just List is a doubly linked list. this means each element in the container has a A cursor or pointer is an indicator used in computer user interfaces such as monitors or other display devices to show the current position of user interaction with the task at hand. The indicator here is usually represented as an arrow in the default state. Based on the function or the software the user is interfacing with, the cursor may... More which points to the element before and after it. The advantage of this sort of Sequence Containers is that you get fast inserts and removes from anywhere on the list.
Other properties include slow searching and no random access. This means the linked list has no  operator. The reason for the slow search in a list is because unlike vector, the elements of a linked list are not stored in contiguous memory.
Therefore there is a lot of swapping going on in and out of the A cache is a hardware or software that is used to store data temporarily in a computing environment for fast access to boost performance. This data is typically a small amount stored in a rapidly accessible storage media so that is can be accessed very fast. Typical components which make use of cache include the CPU, web browsers, and software... More to accommodate these elements and to read out the values.
The following is a sample code snippet showing the implementation of a Linked list.
Forward List (Forward Linked List)
There’s not much more we can say about the Forward linked list except that it is exactly like a list only that the A cursor or pointer is an indicator used in computer user interfaces such as monitors or other display devices to show the current position of user interaction with the task at hand. The indicator here is usually represented as an arrow in the default state. Based on the function or the software the user is interfacing with, the cursor may... More point to the next element in the sequence container.
The STL Array
This is the Standard Template library’s implementation of an array that allows you to use the STL function just like you would on a vector. Just like a normal array and unlike the vector, the STL array is fixed size. Secondly, the sizes of two arrays which differ in size are treated differently.
The sample code shows how you can use an STL array.
That is it for the topic of the Sequence containers in the C++ Standard Template Library. In the next article in this tutorial series, we will be looking at associative containers and discussing sets, multisets, maps, and multimaps.
Meanwhile you can always go back and brush up on the details about the vector in the C++ Standard Template Library.