Learn C++ STL

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

Module 13 · binary_search, lower_bound, upper_bound and equal_range

Problems: binary_search, lower_bound, upper_bound and equal_range

Free with an accountProblems

Ten problems, graded against hidden tests. Each one practises an idea from a lesson of this module, from lesson 01's lost tags to lesson 06's longest chain of boxes. Problems 1, 2 and 5 are free. The other seven open with Learn Pro or with the track.

Checking what this lesson needs for you…

What is inside Problems: binary_search, lower_bound, upper_bound and equal_range

  1. Every starter has the same shape
  2. Sort once, then search in that order
  3. Which bound
  4. When the answer is a number, halve the answers
  5. The first idea, at the largest input