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
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#+ANKI_DECK: study_deck_02
|
||||
* std::binary_search: check element exists :cpp:binary-search:algorithm:retrieval::recognition:
|
||||
:PROPERTIES:
|
||||
:END:
|
||||
|
||||
** Front
|
||||
What does ~std::binary_search~ return, and what must the range be?
|
||||
|
||||
** Back
|
||||
Returns ~bool~ (true if element found). The range must be *sorted*.
|
||||
|
||||
#+begin_src cpp
|
||||
bool found = std::binary_search(vec.begin(), vec.end(), value);
|
||||
#+end_src
|
||||
Reference in New Issue
Block a user