Kak 5 Using the Container Classes

5.1 Container Classes in C++

See Standard Template Library (STL) container classes.

A container is an STL template class that manages a sequence of elements. Such elements can be of any object type that supplies a copy constructor, a destructor, and an assignment operator.

The STL template container classes include:

The Standard C++ Library template class basic_string also meets the requirements for a template container class.

5.1.1 Vector

VectorBasic.cc

VectorFrontBackResize.cc

5.1.1.1 List Operations on Vectors

VectorInsertEraseSort.cc

5.1.1.2 Vector of Class Type Objects

VectorForClassType.cc

5.1.1.3 Using an Array to Initialize a Vector

VectorInitArray.cc

5.1.2 Deque

DequeFront.cc

5.1.3 List

ListOps.cc

5.1.4 Stack

StackOps.cc

5.1.5 Queue

QueueOps.cc

5.1.6 Priority Queue

PriorityQueueOps.cc

5.1.7 Map

MapHist.cc

5.1.8 Set

SetOps.cc

5.2 Containers in Java

See Java Collections Framework Overview.

See also: tutorial on Java Collections.

5.2.1 List

ListOps.java

5.2.2 Set

SetOps.java

5.2.3 Map

MapHist.java

5.2.4 Vector

VectorOps.java

VectorListOps.java

5.4 Homework

problem 2

VectorDest.cc

problem 3

VectorDestOrder.cc


Maintained by John Loomis, last updated 2 Jan 2007