Biblioteca de contenedores
La biblioteca de contenedores es una colección genérica de plantillas de clase que permiten a los programadores implementar estructuras de datos comunes fácilmente, como colas, listas y pilas. Hay tres clases de contenedores - contenedores de secuencias, contenedores asociativos y contenedores asociativos desordenados - cada uno de los cuales está diseñado para dar soporte a un conjunto diferente de operaciones.
El contenedor gestiona el espacio de almacenamiento que es asignado a sus elementos y proporciona funciones miembro para acceder a ellos, ya sea directamente o mediante iteradores (objetos con propiedades similares a los punteros).
La mayoría de los contenedores tienen varias funciones miembro en común, y comparten ciertas funcionalidades. Qué contenedor es mejor para una aplicación particular no sólo depende de la funcionalidad ofrecida, sino también de su eficiencia para los diferentes tipos de trabajo.
[editar] Contenedores de secuencias
Los contenedores de secuencias implementan estructuras de datos que pueden ser accedidas de manera secuencial.
|
|
array contiguo estática Original: static contiguous array The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (clase de plantilla) [edit]
|
|
|
array contiguo dinámico Original: dynamic contiguous array The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (clase de plantilla) [edit]
|
|
|
de doble punta de la cola Original: double-ended queue The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (clase de plantilla) [edit]
|
|
|
la lista simplemente enlazada Original: singly-linked list The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (clase de plantilla) [edit]
|
|
|
lista doblemente enlazada Original: doubly-linked list The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (clase de plantilla) [edit]
|
[editar] Contenedores asociativos
Los contenedores asociativos implementan estructuras de datos ordenadas en las que se puede buscar rápidamente (complejidad O(log n)).
|
|
colección de claves únicas, ordenados por claves Original: collection of unique keys, sorted by keys The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (clase de plantilla) [edit]
|
|
|
colección de pares de valores clave, ordenados por teclas, las teclas son únicos Original: collection of key-value pairs, sorted by keys, keys are unique The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (clase de plantilla) [edit]
|
|
|
collection of keys, sorted by keys (clase de plantilla) [edit]
|
|
|
colección de pares de clave-valor, ordenados por claves Original: collection of key-value pairs, sorted by keys The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (clase de plantilla) [edit]
|
[editar] Contenedores asociativos desordenados
Los contenedores asociativos desordenados implementan estructuras de datos desordenadas (hasheadas) en las que se puede buscar rápidamente (O(1) amortizado, O(n) complejidad en el peor de los casos).
|
|
colección de claves únicas, ordenados por claves Original: collection of unique keys, hashed by keys The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (clase de plantilla) [edit]
|
|
|
colección de pares de clave-valor hash, ordenados por claves, las claves son únicas Original: collection of key-value pairs, hashed by keys, keys are unique The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (clase de plantilla) [edit]
|
|
|
recogida de llaves, ordenados por claves Original: collection of keys, hashed by keys The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (clase de plantilla) [edit]
|
|
|
colección de pares de clave-valor hash, ordenados por claves Original: collection of key-value pairs, hashed by keys The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (clase de plantilla) [edit]
|
[editar] Adaptadores de contenedor
Los adaptadores de contenedor proporcionan una interfaz diferente para contenedores de secuencias.
|
|
adapta un recipiente para proporcionar pila LIFO (estructura de datos) Original: adapts a container to provide stack (LIFO data structure) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (clase de plantilla) [edit]
|
|
|
adapta un recipiente para proporcionar cola (FIFO estructura de datos) Original: adapts a container to provide queue (FIFO data structure) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (clase de plantilla) [edit]
|
|
|
adapta un recipiente para proporcionar cola de prioridad Original: adapts a container to provide priority queue The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (clase de plantilla) [edit]
|
[editar] Tabla de funciones miembro
|
- funciones presentes en C++03
|
|
- funciones presentes desde C++11
|
|
Contenedores de secuencia
|
Contenedores asociativos
|
Contenedores asociativos desordenados
|
Adaptadores de contenedor
|
Cabeceras
|
<array>
|
<vector>
|
<deque>
|
<forward_list>
|
<list>
|
<set>
|
<map>
|
<unordered_set>
|
<unordered_map>
|
<stack>
|
<queue>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(implicit)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(implicit)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(implicit)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
N/A
|
|
|
|
|
N/A
|
N/A
|
N/A
|
N/A
|
N/A
|
N/A
|
N/A
|
N/A
|
N/A
|
N/A
|
N/A
|
Iterators
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
N/A
|
N/A
|
N/A
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
N/A
|
N/A
|
N/A
|
|
|
|
|
N/A
|
|
|
|
|
|
N/A
|
N/A
|
N/A
|
N/A
|
N/A
|
N/A
|
N/A
|
|
|
|
|
N/A
|
|
|
|
|
|
N/A
|
N/A
|
N/A
|
N/A
|
N/A
|
N/A
|
N/A
|
Element access
|
|
|
|
|
N/A
|
N/A
|
N/A
|
N/A
|
|
N/A
|
N/A
|
N/A
|
|
N/A
|
N/A
|
N/A
|
N/A
|
|
|
|
|
N/A
|
N/A
|
N/A
|
N/A
|
|
N/A
|
N/A
|
N/A
|
|
N/A
|
N/A
|
N/A
|
N/A
|
|
|
|
|
|
|
N/A
|
N/A
|
N/A
|
N/A
|
N/A
|
N/A
|
N/A
|
N/A
|
N/A
|
|
|
|
|
|
|
N/A
|
|
N/A
|
N/A
|
N/A
|
N/A
|
N/A
|
N/A
|
N/A
|
N/A
|
|
|
N/A
|
Capacity
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
N/A
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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