+ 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.
8 odpowiedzi
+ 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
+ 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 ?
+ 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...
+ 2
parag sahu yes :)
+ 2
Tibor Santa thank you so much sir.:-)
+ 2
I'm curious to know why you wanted to learn dynamic programming.
+ 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.
+ 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.