Explore a usage example of both vectors and lists, featuring iterators, and a comparison of the dynamics of these data structures.
- [Lecturer] Now, let's solve a basic problem…to illustrate how to use the vector…and the list container classes.…Let's say we are interested in keeping track of guests…who are children at a small birthday party.…The simple purpose of this could be to handle…the logistics for catering and party favors.…We are interested in keeping track…of the following information per child,…the name, the gender, and the age.…So let's see how the C++ STL can help.…
Here we have an application I have written…that still needs some work.…We will have to insert some lines of code…to make it work for a vector or for a list.…Starting at line five, we include the header files…that will be useful in this application.…First we have iostream and string.…Next we have fstream which is for reading files.…And finally, we have vector and list.…In this application, we will read a whole file,…which will have child entries as required…and we will print out what we have read.…
All of this data will be stored in a vector or a list…and the way we will choose what to use will be as shown…
- Why the STL is important
- Containers and iterators
- Vectors and lists
- Stacks and dequeues
- Associative containers
Skill Level Advanced
1. The Standard Template Library
2. Vectors and Lists
3. Stacks, Queues, and Deques
4. Associative Containers
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.