Concepts32
Knapsack Problems
Knapsack problems ask how to pick items under a weight (or cost) limit to maximize value or to check if a target sum is reachable.
Coin Change and Variants
Coin Change uses dynamic programming to find either the minimum number of coins to reach a target or the number of ways to reach it.
Dynamic Programming Fundamentals
Dynamic programming (DP) solves complex problems by breaking them into overlapping subproblems and using their optimal substructure.
DP State Design
Dynamic Programming (DP) state design is the art of choosing what information to remember so that optimal substructure can be reused efficiently.
Floyd-Warshall Algorithm
FloydโWarshall computes the shortest distances between all pairs of vertices in O(n^3) time using dynamic programming.
Topological Sort - DP on DAG
Topological sort orders vertices of a directed acyclic graph (DAG) so every edge goes from earlier to later, which is perfect for dynamic programming (DP).
Aho-Corasick - DP Applications
AhoโCorasick (AC) turns a set of forbidden patterns into a finite automaton that lets you process or generate strings while tracking whether any pattern appears.
Palindromic Tree (Eertree)
A Palindromic Tree (Eertree) stores every distinct palindromic substring of a string as a node and can be built online in linear time.