Session 20 of Software Lessons, “Programming in C++: Data Structures Part 1,” runs about 26 minutes.
What this session covers
- Introduction to data structures
- Arrays, vectors and lists
Key ideas
- A data structure organizes data in memory so that particular operations, such as lookup or insertion, are efficient.
- Linear structures store items in a sequence, and an array keeps them in one contiguous block of memory with a fixed size.
- A vector is a resizable array, and a linked list stores items in separate nodes that point to each other.
- Associative containers store items by key instead of by position.
- Users can define their own structures by combining fields into a struct or class.