e10cc4257d
- 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
372 B
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).