You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Here are a few other resources that I found helpful when learning <b>Data Struct
19
19
-[Run JS](https://runjs.app/) - A JavaScript playground
20
20
for your desktop
21
21
-[Big O CheatSheet](https://www.bigocheatsheet.com/) - Reference for <b>Big-O</b> complexities of common algorithms
22
-
-[Blind 75](https://www.teamblind.com/post/New-Year-Gift---Curated-List-of-Top-75-LeetCode-Questions-to-Save-Your-Time-OaM1orEU) - For additional practice, the [Blind75 list](https://www.teamblind.com/post/New-Year-Gift---Curated-List-of-Top-75-LeetCode-Questions-to-Save-Your-Time-OaM1orEU) of interview questions is 🔥. I would approach the questions in [this order](https://www.techinterviewhandbook.org/best-practice-questions) or [create a custom Blind75 study plan](https://www.techinterviewhandbook.org/grind75)
22
+
-[Blind 75](https://www.teamblind.com/post/New-Year-Gift---Curated-List-of-Top-75-LeetCode-Questions-to-Save-Your-Time-OaM1orEU) - For additional practice, the [Blind75 list](https://www.teamblind.com/post/New-Year-Gift---Curated-List-of-Top-75-LeetCode-Questions-to-Save-Your-Time-OaM1orEU) of interview questions is 🔥. I would approach the questions in [this order](https://www.techinterviewhandbook.org/best-practice-questions) or [this order](https://neetcode.io/) or [create a custom Blind75 study plan](https://www.techinterviewhandbook.org/grind75)
23
23
-[Edabit](https://edabit.com/) is a great resource if you need additional <b>Javascript</b> practice before you start using <b>leetcode</b>.
24
24
-[LeetCode](https://leetcode.com/problemset/all/) of course
Copy file name to clipboardExpand all lines: ✅ Pattern 15: 0-1 Knapsack (Dynamic Programming).md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -112,7 +112,7 @@ console.log(`6th Fibonacci is ---> ${calculateFibonacci(6)}`);
112
112
console.log(`7th Fibonacci is ---> ${calculateFibonacci(7)}`);
113
113
```
114
114
115
-
<b>In this course, we will always start with a brute-force recursive solution, which is the best way to start solving any DP problem!</b> Once we have a recursive solution then we will apply Memoization and Tabulation techniques.
115
+
<b>In this course, we will always start with a brute-force recursive solution, which is the best way to start solving any DP problem!</b> Once we have a recursive solution then we will apply <i>memoization</i> and Tabulation techniques.
116
116
117
117
Let’s apply this knowledge to solve some of the frequently asked <b>DP</b> problems.
118
118
@@ -4107,7 +4107,7 @@ function findMPPCuts(str) {
4107
4107
dpIsPalindrome[start][end] =false;
4108
4108
break;
4109
4109
}
4110
-
//use memoization to find if the remaining string is a palindrome
4110
+
//use <i>memoization</i> to find if the remaining string is a palindrome
4111
4111
dpIsPalindrome[i] = dpIsPalindrome[i] || [];
4112
4112
if (i < j &&typeof dpIsPalindrome[i][j] !=='undefined') {
- Since our memoization array `dp[nums.length()][nums.length()]` stores the results for all the <i>subproblems</i>, we can conclude that we will not have more than `N*N` <i>subproblems</i> (where `N` is the length of the input sequence). This means that our <b>time complexity</b> will be `O(N²)`.
4826
+
- Since our <i>memoization</i> array `dp[nums.length()][nums.length()]` stores the results for all the <i>subproblems</i>, we can conclude that we will not have more than `N*N` <i>subproblems</i> (where `N` is the length of the input sequence). This means that our <b>time complexity</b> will be `O(N²)`.
4827
4827
- The above algorithm will be using `O(N²)` <b>space</b> for the <i>memoization array</i>. Other than that we will use `O(N)` <b>space</b> for the <i>recursion call-stack</i>. So the total <b>space complexity</b> will be `O(N² +N)`, which is <i>asymptotically</i> equivalent to `O(N²)`.
4828
4828
4829
4829
### Bottom-up Dynamic Programming
@@ -4867,7 +4867,7 @@ console.log(
4867
4867
// Output: 4
4868
4868
// Explanation: The LIS is {-4,3,7,15}.
4869
4869
```
4870
-
-The <b>time complexity</b> of the above algorithm is `O(N²)` and the <b>space complexity</b> is `O(n)`.
4870
+
-The <b>time complexity</b> of the above algorithm is `O(N²)` and the <b>space complexity</b> is `O(n)`.
0 commit comments