whatthefuck.is icon indicating copy to clipboard operation
whatthefuck.is copied to clipboard

WTF is Dynamic Programming

Open sr229 opened this issue 4 years ago • 1 comments

I think people should also learn a lot with algorithms, especially this.

sr229 avatar Jul 19 '20 01:07 sr229

It's a way of finding a solution for a complex problem by dividing into sub-problems.it is a good approach while dealing with the time complexity problems because its(problem solved using dp) time complexity is less where as space complexity arise in the worst cases .the thing is we can do dynamic programming using a top-down approach or bottom-up approach . For example ,take an example of printing n fibanocci numbers where n =10^11 .time limit is 1 second .when you do this using recursion,it surely raises TIME COMPLEXITY ERROR .the best way is to use dp .I advise you to see dp problems on any study platform like udemy, youtube so that you can get a better idea of it .

raghunadh10 avatar Aug 03 '20 03:08 raghunadh10