-
Containers Library (def'n)
Generic collection of class templates and algorithms that allow programmers to easily implement common data structures like queues, lists and stacks.
-
The classes of containers (list)
- sequence containers
- associative containers
- unordered associative containers
-
sequence containers (def'n)
These containers implement data structures which can be accessed sequentially.
-
The types of sequence containers (list them)
- array(C++11) static contiguous array
- vector dynamic contiguous array
- deque double-ended queue
- forward_list(C++11) singly-linked list
- list
doubly-linked list
-
Associative containers (list them)
- set: collection of unique keys, sorted by keys
- map: collection of key-value pairs, sorted by keys, keys are unique
- multiset collection of keys, sorted by keys
- multimap collection of key-value pairs, sorted by keys
-
Associative containers(def'n)
These containers implement sorted data structures that can be quickly searched (O(log n) complexity).
-
Unordered associative containers (def'n)
These ontainers implement unsorted (hashed) data structures that can be quickly searched (O(1) amortized, O(n) worst-case complexity).
-
Unordered Associatie containers; (def'n)
- unordered_set(C++11)collection of unique keys, hashed by keys
- unordered_map(C++11) collection of key-value pairs, hashed by keys, keys are
- uniqueunordered_multiset(C++11)collection of keys, hashed by keys
- unordered_multimap (C++11)collection of key-value pairs, hashed by keys
-
Order of performance for Big-O Notation from worst...to best.
- 1. O(n!) terrible
- 2. O(2n) terrible
- 3. O(n2) terrible
- 4. O(n log n) bad
- 5. O(n) fair
- 6. O(log n), O(1) excellent
-
Virtual Destructor (def'n)
If deleting derived class object using a pointer to a base class results in undefined behavior....to correct this situation, the base class should be defined with one of these.
|
|