Please enable JavaScript to use CodeHS

Data Structures in C++

Lesson 5.1 Pairs and Iterators

Description

In this lesson, students learn how to create and use pairs and iterators. While these tools will not be used extensively here, both of them will be used later in the module as students explore sets and maps.


Objective

Students will be able to:

  • Explain how pairs and iterators are used and how they differ from other tools in C++
  • Create and use a pair in the proper setting
  • Iterate through a vector using an iterator