Memoization tables and optimal substructure — watch subproblems fill in real time.
7 visualizations
Computes Fibonacci with top-down memoization, caching each subproblem so it's solved only once.
Maximizes value under a weight limit where each item is taken whole or not at all, via a DP table.
Finds the longest subsequence common to two strings by filling a 2-D DP table, then tracing it back.
Computes the minimum number of insertions, deletions, and substitutions to transform one string into another.
Finds the fewest coins that sum to a target amount, allowing each denomination to be reused any number of times.
Finds the contiguous subarray with the largest sum in a single linear pass using Kadane's algorithm.
Finds the longest strictly increasing subsequence via an O(n²) DP, tracking predecessors to rebuild the chain.