I've started learning Dynamic programming recently. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

I've started learning Dynamic programming recently.

For that I m focussing on recusion.Sometimes I am able to solve the questions but most of the time I find the questions very hard and I m unable to crack it. That really demotivates me. There are very professional programmer here so I hope u will help me.

22nd Feb 2020, 4:11 AM
parag sahu
parag sahu - avatar
8 Answers
+ 2
Dynamic programming can be really tricky, if you have to come up with your own algorithm from scratch. My advice is to study many examples, you can find plenty on geeksforgeeks or youtube, try to reproduce the logic in your head, and when you think you understand, try to rewrite it by not looking at the source :) This guy helped me a lot to gain a better understanding of the concept: https://youtu.be/vYquumk4nWw
22nd Feb 2020, 5:17 AM
Tibor Santa
Tibor Santa - avatar
+ 2
Tibor Santa thnx bro for your help. Actually when I started doing question then many of the times I have to see the answer and that makes me feel that this example is wasted as I know the logic now. What to do for that ?
22nd Feb 2020, 5:27 AM
parag sahu
parag sahu - avatar
+ 2
That's a good question but I am not really qualified to answer from pedagogical point of view. Learning logical thinking is very different from simply memorizing things, for some people it's trivial but many struggle with it. Maybe you can tweak it by this type of learning app: https://play.google.com/store/apps/details?id=org.brilliant.android Don't be discouraged if you can't figure out the solution on your own at the first attempt. When you see many of these types of problems, eventually you will see patterns and get the idea. For me, the way to understanding and mastering recursion was really accelerated by learning Haskell language. Once you get the recursive part of the solution right, the rest of DP is about optimization...
22nd Feb 2020, 5:46 AM
Tibor Santa
Tibor Santa - avatar
+ 2
parag sahu yes :)
22nd Feb 2020, 5:52 AM
Tibor Santa
Tibor Santa - avatar
+ 2
Tibor Santa thank you so much sir.:-)
22nd Feb 2020, 5:53 AM
parag sahu
parag sahu - avatar
+ 2
I'm curious to know why you wanted to learn dynamic programming.
24th Feb 2020, 1:16 AM
Sonic
Sonic - avatar
+ 2
Sonic Because i came across some questions where my iterative code takes a lot of time . I mean it has a hight time complexity because of it many of the test cases failed when I submit my solution at coding platform. So dynamic programming is way to optimize your code. This is the reason I wanted to learn it.
24th Feb 2020, 2:36 AM
parag sahu
parag sahu - avatar
+ 1
Tibor Santa so you mean that I should solve questions as much as I can. It doesn't matter if I successfully solved it or not , or I saw the solution after trying .The point is I will only get better.
22nd Feb 2020, 5:51 AM
parag sahu
parag sahu - avatar