Week 6 - Intro to Data Structures and Algorithms
Learning objectives
Upon finishing this week, you should be able to:
- Use std containers like list, set, and map
- Describe the differences between various container types
- Use iterators to traverse various container types
- Use standard algorithms with containers
Suggested pacing
Day 1
- Midterm
Day 2
- Start Containers and Algorithms Ch 21.1-21.3
Day 3
- Continue Containers and Algorithms Ch 21.4-21.9
- Start the Ch 21 Exercises (you are ready for the first three problems, save the other)
Day 4
- Continue Containers and Algorithms Ch 21.10-21.14 Note that the reading stops at 21.14. We will not be covering 21.15-16 right now, but will revisit them later.
- Do the assignment
Activity Outline
This week marks a transition in focus from core programming concepts to using those concepts to build complex data structures and algorithms.
We will continue to learn some new C++ syntax and programming ideas, but more and more of our time will be spent using the ideas we know to build useful tools.
This week we are essentially doing a quick overview of the kinds of things we will be building in the rest of this course and in CS260.
Containers and Algorithms
There are many ways to organize data in a program beyond just using a vector. C++ provides a number of built-in container types that implement common data structures (as do most other programming languages).
In addition, the C++ standard library provides a large number of algorithms that can be used to manipulate data in these containers.
Read Ch 21.1-21.14.
These optional videos may help:
std::lists (Ch 21.1):
Iterators and Traversal (Ch 21.2-3):
Sets (Ch 21.4-6):
Maps (Ch 21.7-21.9):
Algorithms (Ch 21.10-21.14):