Files
cpp-flashcards/org/study_deck_02/dsa/binary-search/std-lower-bound.org
T

15 lines
384 B
Org Mode
Raw Normal View History

#+ANKI_DECK: study_deck_02
* std::lower_bound: find position of element :cpp:binary-search:algorithm:retrieval::recognition:
:PROPERTIES:
:END:
** Front
What does ~std::lower_bound~ return?
** Back
An iterator to the first element *>=* the given value. Returns ~end()~ if no such element exists.
#+begin_src cpp
auto it = std::lower_bound(vec.begin(), vec.end(), value);
#+end_src