rez901's blog

By rez901, history, 6 years ago, In English

Dynamic programming is basically a technique to solve a big problem efficiently. Some people say that to solve a dynamic problem you need pure intelligence , but wouldn't agree with it. Rather i would say DP is a skill based technique .The more you practice DP the more you will be skilled.

Before solving a DP problem , You have to identify whether that is a DP problem or not. Why that is a DP problem and where to apply the DP technique.if you get the point then you are one step ahead to solve that problem .

After identifying the problem as a DP your next approach should be solve the problem using PEN and SHEET .Remember , you have to find some relation among data calculated before and you will calculate after some time. once you get the relation you can write a code easily then.

Your another thinking maybe about dividing the problem and word with root part. thing at root level , that will easier to solve , then try to combine the solution . And use memorization as you know it will give you efficiency as you don't need to solve same part again and again.

Another tricks is to relate the problem with real life scenario . Think about the 0-1 Knapsak problem . what did you do ? Our approach was like whether we will take the next element or not. if we take the the next element then we will get some value otherwise the value is 0 . Another thing is forwarding skipping that element. so, if can relate the problem in real life scenario then it will easier to solve..

Finally what i want to say is you have to practice a lot be be a BOSS is DP . So, practice practice and practice.. Happy DP problem Solving

Full text and comments »

  • Vote: I like it
  • -28
  • Vote: I do not like it