Idea: turn a TI-84/ Gameboy/DS into a meshtastic client |
Links | RSS | |
| Author | ArgentumCation | Posts | Notes |
|---|---|---|---|
| License | CC-BY-NC-SA 4.0+ | Updated | |
DFS / BFS
k Smallest/largest use a heap/sorting?
Can brute force of params are super small otherwise use DP
if linked list or if multiple sequences, use two pointers
if it’s a DAG, use a toposort
if it involves summing a subset, prefix sum (constant time)
if searching min/max of monotonic, can just do binary search
if not monotonic, but can split up use DP
if can’t use DP, greedy search
if counting, do backtracking or DP
if multiple lists or pairs of indices/ use two pointer
use two pointer for O(1) mem
Two pointer
Sliding Window
Graph is tree with cycles
BFS
DFS is just BFS with stack instead of queue
BFS finds shortest/ DFS finds all