Skip to content

Commit 802029f

Browse files
authored
Merge pull request #1269 from Zyad-Ayad/master
Added Descriptions to Classic DP Problems
2 parents 2a1dc12 + ff4b380 commit 802029f

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

src/dynamic_programming/intro-to-dp.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -130,19 +130,22 @@ That's it. That's the basics of dynamic programming: Don't repeat work you've do
130130
One of the tricks to getting better at dynamic programming is to study some of the classic examples.
131131

132132
## Classic Dynamic Programming Problems
133-
- 0-1 Knapsack
134-
- Subset Sum
135-
- Longest Increasing Subsequence
136-
- Counting all possible paths from top left to bottom right corner of a matrix
137-
- Longest Common Subsequence
138-
- Longest Path in a Directed Acyclic Graph (DAG)
139-
- Coin Change
140-
- Longest Palindromic Subsequence
141-
- Rod Cutting
142-
- Edit Distance
143-
- Bitmask Dynamic Programming
144-
- Digit Dynamic Programming
145-
- Dynamic Programming on Trees
133+
| Name | Description/Example |
134+
| ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
135+
| 0-1 knapsack | Given $W$, $N$, and $N$ items with weights $w_i$ and values $v_i$, what is the maximum $\sum_{i=1}^{k} v_i$ for each subset of items of size $k$ ($1 \le k \le N$) while ensuring $\sum_{i=1}^{k} w_i \le W$? |
136+
| Subset Sum | Given $N$ integers and $T$, determine whether there exists a subset of the given set whose elements sum up to the $T$. |
137+
| Longest Increasing Subsequence | You are given an array containing $N$ integers. Your task is to determine the LCS in the array, i.e., LCS where every element is larger than the previous one. |
138+
| Counting all possible paths in a matrix. | Given $N$ and $M$, count all possible distinct paths from $(1,1)$ to $(N, M)$, where each step is either from $(i,j)$ to $(i+1,j)$ or $(i,j+1)$. |
139+
| Longest Common Subsequence | You are given strings $s$ and $t$. Find the length of the longest string that is a subsequence of both $s$ and $t$. |
140+
| Longest Path in a Directed Acyclic Graph (DAG) | Finding the longest path in Directed Acyclic Graph (DAG). |
141+
| Longest Palindromic Subsequence | Finding the Longest Palindromic Subsequence (LPS) of a given string. |
142+
| Rod Cutting | Given a rod of length $n$ units, Given an integer array cuts where cuts[i] denotes a position you should perform a cut at. The cost of one cut is the length of the rod to be cut. What is the minimum total cost of the cuts. |
143+
| Edit Distance | The edit distance between two strings is the minimum number of operations required to transform one string into the other. Operations are ["Add", "Remove", "Replace"] |
144+
145+
## Related Topics
146+
* Bitmask Dynamic Programming
147+
* Digit Dynamic Programming
148+
* Dynamic Programming on Trees
146149

147150
Of course, the most important trick is to practice.
148151

@@ -154,3 +157,7 @@ Of course, the most important trick is to practice.
154157
* [LeetCode - 221. Maximal Square](https://leetcode.com/problems/maximal-square/description/)
155158
* [LeetCode - 1039. Minimum Score Triangulation of Polygon](https://leetcode.com/problems/minimum-score-triangulation-of-polygon/description/)
156159

160+
## Dp Contests
161+
* [Atcoder - Educational DP Contest](https://atcoder.jp/contests/dp/tasks)
162+
* [CSES - Dynamic Programming](https://cses.fi/problemset/list/)
163+

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy