Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

BLUF

C++ containers are a set of data structures that are used to store and organize collections of data. There are several different types of containers available in C++, each with its own set of features and characteristics.

Here are some common C++ containers:

  1. Arrays: A fixed-size container that can store a collection of elements of the same data type in contiguous memory.

  2. Vectors: A dynamic array that can grow or shrink as elements are added or removed. Vectors are similar to arrays but provide additional functionality, such as the ability to resize the container dynamically.

  3. Lists: A container that stores elements in a linked list. Lists are efficient for inserting or removing elements at any position, but accessing elements is slower than with arrays or vectors.

  4. Maps: A container that stores key-value pairs in a sorted order. Maps are efficient for searching and retrieving data based on a key.

  5. Sets: A container that stores unique elements in a sorted order. Sets are useful when you need to maintain a collection of elements without duplicates.

  6. Queues: A container that stores elements in a FIFO (first-in, first-out) order. Queues are useful when you need to process elements in the order they were added.

  7. Stacks: A container that stores elements in a LIFO (last-in, first-out) order. Stacks are useful when you need to process elements in reverse order.

Each of these containers has its own set of methods and functions that can be used to manipulate the data it stores. For example, you can add elements to a vector using the push_back method, or remove elements from a list using the erase method. Choosing the right container for your needs depends on the specific requirements of your program, such as the type of data being stored, the operations that need to be performed, and the expected size and complexity of the container.

\uD83D\uDCD8 Outline

\uD83D\uDCCB To Do

  1. Containers Active Reading

  2. Review Student Notes

  3. Complete Lab 1 and 2

  • No labels