LearnFrenzy
Sign in Take a free test

STL Algorithms and Iterators · STL Algorithms MCQ · Question 7

What does lower_bound return? Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 7 Back to Exercise

On a sorted range, what does std::lower_bound(b, e, x) return?

  • A The last element ≤ x
  • B An iterator to the first element ≥ x (or e if none) Correct
  • C The index of x
  • D true or false
Correct Answer: Option B

upper_bound returns the first element > x.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links