Files
cpp-flashcards/org/study_deck_02/dsa/binary-search/lower-bound-vs-binary-search.org
T
tomatocream e10cc4257d add flashcard generation tooling and binary search cards
- gen-flashcards.py: auto-generate recognition cards from all problem files
- toolkit/gen-problem-cards.org: 199 auto-generated problem cards
- 5 binary search tool cards (std::binary_search, std::lower_bound, comparison, two-sum pattern, sorting gotcha)
- two-sum.org: add binary search C++ attempt
- lc-org.el: add doom emacs localleader keybinding support
2026-06-08 11:38:09 +08:00

372 B

When to use lower_bound vs binary_search :cpp:binary-search:algorithm:retrieval::recognition:

Front

When should you use std::lower_bound instead of std::binary_search?

Back

Use lower_bound when you need the position/index of the element. Use binary_search when you only need to know if it exists (bool).