# Chapter 15 - Worked Exercises 3

## Exercise 1&#x20;

Define the data structure that is internally used by the `std::vector` class, the `std::list` class, and the `std::deque` class.

Draw a diagram for each of these container classes, illustrating how elements in the container class are stored in memory.&#x20;

## Exercise 2&#x20;

Complete the table below for the **performance of insertion/removal of elements** at each position for each container class.&#x20;

Specify whether the operation is done at constant time, or at linear time, with a small explanation why.&#x20;

|                                    | `std::vector` | `std::list` | `std::deque` |
| ---------------------------------- | ------------- | ----------- | ------------ |
| Insertion or removal at the front  |               |             |              |
| Insertion or removal at the middle |               |             |              |
| Insertion or removal at the back   |               |             |              |

## Exercise 3&#x20;

Complete the **Restaurant Queuing System** from Worked Exercises 1, which makes use of the `std::deque` class.&#x20;

{% embed url="<https://tutoring.cho.io/15/exercises-1#exercise-1-restaurant-queuing-system>" %}
