Introduction to the Standard Container/Algorithm Library
- I think that some of our work has indicated that this would be useful now.
- Read 514-532
- Read 542-561 (vectors later)
- Look at The vector class on cplusplus.com.
- In addition, I plan to go onto testing and this would also be useful in testing.
- Caution you may only use these when given permission.
- I plan on having you implement some of these
- So your use is still limited.
- For now, since you built the dynamic array class last semester, you may use vectors.
- You may also use find and sort.
- The standard containers are implementations of well known data types.
- They are implemented as templates which means that they can hold whatever data you need.
- They have a common set of characteristics when it makes sense
- But they have unique methods based on what they do.
- The containers include
- This first set stores items sequentially, so they are sequential containers.
- The array class
- A better version of the C array we learned last semester.
- The vector class
- A dynamic array.
- Your new favorite thing.
- A forward_list class
- A singly linked list
-
- A list class
- Doubly linked list
-
- The next three store items based on some criteria (time, importance, ...)
- queue
- priority_queue
- stack
- The set and multi-set store a collection of items.
- These behave like mathematical sets.
- All items in a set are unique, not so for multi sets.
- Maps and related.
- Are arrays where the index is a string.
- The standard algorithm library
- A set of really useful functions.
- Sorting, searching,
- And many others.