sm2-flashcards

Spaced-repetition flashcards. Trie autocomplete on tags; SM-2 scheduling.

Search tags

Live prefix lookup against the Trie. Try tr, gr, or ha.

Add a card

Cards

What is the "Complement Tracking" pattern?
Instead of searching forward for a match in an array with nested loops, you calculate what matching value you NEED, and check a Hash Map to see if you have already seen it.
patternsarrayshash-map · rep 0 · ef 1.70 · next 2026-05-20 16:00 UTC
When is topological sort the right tool?
Ordering tasks with prerequisites: build systems, course schedules, dependency resolution.
graphstopo-sort · rep 1 · ef 2.36 · next 2026-05-20 16:01 UTC
Hash map collision strategies?
Separate chaining (linked lists in buckets) and open addressing (linear/quadratic probing).
hash-maphashing · rep 0 · ef 1.70 · next 2026-05-20 16:01 UTC
Two-pointer technique — when to reach for it?
Sorted arrays, palindromes, partitioning. Two indices moving toward each other or in tandem.
arraystwo-pointer · rep 1 · ef 2.50 · next 2026-05-20 16:01 UTC
What is the sliding-window pattern good for?
Subarray/substring problems with a contiguous range — turns O(n²) brute force into O(n).
arrayssliding-window · rep 1 · ef 2.50 · next 2026-05-20 16:01 UTC
Define BFS (breadth-first search).
Level-order graph traversal using a queue. Visits all nodes at distance d before d+1.
graphsbfs · rep 1 · ef 2.36 · next 2026-05-20 16:02 UTC
What's the time complexity of inserting into a Trie?
O(k) where k is the key length — independent of how many words are already stored.
triecomplexity · rep 1 · ef 2.50 · next 2026-05-20 16:02 UTC