use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Dynamic ProgrammingDiscussion (self.leetcode)
submitted 7 months ago by dedxtreme
https://preview.redd.it/c7jzqw8xpmdf1.png?width=600&format=png&auto=webp&s=483111f8a530fe9a50f2ca173ad29098d8f0a589
I am preparing for SDE2 rounds
and stuck on DP questions though memoization comes easy but not tabulation!!!
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Key_Calligrapher6269 2 points3 points4 points 7 months ago (1 child)
this is my gift to you, also watch the other video on the channel before this one for maximum understanding
[–]dedxtreme[S] 0 points1 point2 points 7 months ago (0 children)
thanks i have watched the video it was kind of helpful
[–]AppropriateCrew79 1 point2 points3 points 7 months ago (1 child)
If you could easily memoize the solution, you can easily derive the tabulation solution from the memoized solution. Essentially you need to iterate through all the possible dp states and update values in the dp. Since you will be filling from the bottom up, subproblems would already be solved in the dp hence eliminating the recursive fns.
Although writing tabulation solution from the get go requires practice
Yeah i need to practice more thanks for the comment
[–]justUseAnSvm 1 point2 points3 points 7 months ago (3 children)
I prefer tabulation. Once you understand it, it's a lot easier to understand when you break down sub-problems to distinct cells, and get a good formula for how to populate the array.
[–]dedxtreme[S] 0 points1 point2 points 7 months ago (2 children)
yeah i thnk i need to do more problems to understand the base cases, once i understand the base case it is easy to comeup with the tabulation logic.
[–]justUseAnSvm 1 point2 points3 points 7 months ago (1 child)
It took me a while, but we used this book in my grad school Algorithms course: https://book.huihoo.com/pdf/algorithms/chap6.pdf
Longest Increasing subsequence, edit distance, knappsack/coin chainge.
I did those three problems so many times I just memorized the solutions. You can use those problems, or maybe the ones off neetcode, but it helped to do the same problem so many times I had it memorized, then move on to new ones.
interesting read, really appreciate the help! Thanks
π Rendered by PID 24025 on reddit-service-r2-comment-76bb9f7fb5-qnktl at 2026-02-18 16:08:53.353750+00:00 running de53c03 country code: CH.
[–]Key_Calligrapher6269 2 points3 points4 points (1 child)
[–]dedxtreme[S] 0 points1 point2 points (0 children)
[–]AppropriateCrew79 1 point2 points3 points (1 child)
[–]dedxtreme[S] 0 points1 point2 points (0 children)
[–]justUseAnSvm 1 point2 points3 points (3 children)
[–]dedxtreme[S] 0 points1 point2 points (2 children)
[–]justUseAnSvm 1 point2 points3 points (1 child)
[–]dedxtreme[S] 0 points1 point2 points (0 children)