What is dynamic programming? — Dynamic programming is a general-purpose algorithm design technique that is most often used to solve combinatorial optimization problems, where we are looking for the best possible input to some function chosen from an exponentially large search space. There are two parts to dynamic programming. The first part is a programming technique: dynamic programming is essentially divide and conquer run in reverse: we solve a big instance of a problem by breaking it up recursively into smaller instances; but instead of carrying out the computation recursively from the top down, we start from the bottom with the smallest instances of the problem, solving each increasingly large instance in turn and storing the result in a table. The second part is a design principle: in building up our table, we are careful always to preserve alternative solutions we may need later, by delaying commitment to particular choices to the extent that we can. The bottom-up aspect of dynamic programming is most useful when a straightforward recursion would produce many duplicate subproblems. It is most efficient when we can enumerate a class of subproblems that doesn't include too many extraneous cases that we don't need for our original problem.

G
picture loading error handler
1227 thought(s)1.2K

Google Interview

This flashcard deck made by jwasham contains knowledge about google interview. For more details, please follow https://github.com/jwasham/google-interview-university
interview
computer science
development

Explore more quotes

ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha
ahmed kamel taha