Visual complexity
Try to compress the visualization to take less space in the mind. Use a 3d compression!
- imagine adding numbers to a stack
- make the stack monotonic and imagine popping off numbers (increasing/decreasing)
- imagine next-greater / next-smaller problems
3d stack
Linear stack
Increasing stack (weight interpretation)
- Imagine a sliding window, growing and shrinking by some condition (sum/freq map)
3d recursion
Linear recursion
- Recursion, but with cached results
nested loop