---
name: "Sequences"
section: "3"
platform: "linux"
package: "libstdc++6-4.1-doc"
version: "4.1.2-25"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/Sequences"
---

# Sequences(3)

## NAME

Sequences -

## SYNOPSIS

## Detailed Description

Sequences arrange a collection of objects into a strictly linear order.

The differences between sequences are usually due to one or both of the following:

- •

  memory management

- •

  algorithmic complexity

As an example of the first case, `vector` is required to use a contiguous memory layout, while other sequences such as `deque` are not.

The prime reason for choosing one sequence over another should be based on the second category of differences, algorithmic complexity. For example, if you need to perform many inserts and removals from the middle of a sequence, `list` would be ideal. But if you need to perform constant-time access to random elements of the sequence, then `list` should not be used.

All sequences must meet certain requirements, summarized in `tables`.

### Classes

class **basic\_string**\
 *Managing sequences of characters and character-like objects.*  class **deque**\
 *A standard container using fixed-size memory allocation and constant-time manipulation of elements at either end.*  class **list**\
 *A standard container with linear time access to elements, and fixed time insertion/deletion at any point in the sequence.*  class **priority\_queue**\
 *A standard container automatically sorting its contents.*  class **queue**\
 *A standard container giving FIFO behavior.*  class **stack**\
 *A standard container giving FILO behavior.*  class **vector**\
 *A standard container which offers fixed time access to individual elements in any order.*  class **vector\< bool, \_Alloc \>**\
 *A specialization of* **vector** *for booleans which offers fixed time access to individual elements in any order.*
