Concepts32

โš™๏ธAlgorithmIntermediate

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.

#0/1 knapsack#unbounded knapsack#bounded knapsack+12
โš™๏ธAlgorithmIntermediate

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.

#coin change#dynamic programming#unbounded knapsack+12
โš™๏ธAlgorithmIntermediate

Dynamic Programming Fundamentals

Dynamic programming (DP) solves complex problems by breaking them into overlapping subproblems and using their optimal substructure.

#dynamic programming#memoization#tabulation+12
โš™๏ธAlgorithmIntermediate

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.

#dynamic programming#dp state#bitmask dp+11
โš™๏ธAlgorithmIntermediate

Floyd-Warshall Algorithm

Floydโ€“Warshall computes the shortest distances between all pairs of vertices in O(n^3) time using dynamic programming.

#floyd-warshall#all pairs shortest path#apsp+12
โš™๏ธAlgorithmIntermediate

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).

#topological sort#dag dp#longest path dag+12
๐Ÿ—‚๏ธData StructureAdvanced

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.

#aho-corasick#automaton dp#forbidden substrings+12
๐Ÿ—‚๏ธData StructureAdvanced

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.

#palindromic tree#eertree#palindromic substrings+12