Learn C++ STL

Lesson 8 of 9 · binary_search, lower_bound, upper_bound and equal_range

Module 13 · binary_search, lower_bound, upper_bound and equal_range

Cheat Sheet: Binary Search and the Bounds on One Page

ProReading

This page is the module on one sheet, for the moment before a contest or an interview. Every line here was taught, run or measured in lessons 01 to 06. Nothing is new. Print it, or keep it open beside the editor.

Checking what this lesson needs for you…

What is inside Cheat Sheet: Binary Search and the Bounds on One Page

  1. The four calls and what they return
  2. The six counts
  3. The comparator rule
  4. The cost on each container
  5. Binary search on the answer
  6. The longest increasing subsequence in five lines
  7. The C++20 forms
  8. Which tool, in one table
  9. The eight traps

Module test

Ten questions on this module. Pass at 70%, and you can take it as many times as you like.

Take the module test