Skip to content

This repository contains the most important questions of dynamic programming and variations of each question so that it becomes easy to identify which approach is to applied in the given question.

License

Notifications You must be signed in to change notification settings

somya1212/dynamicProgramming-Important-Codes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dynamicProgramming-Important-Codes

This repository contains the most important questions of dynamic programming and variations of each question so that it becomes easy to identify which approach is to applied in the given question.

Introduction:

Dynamic Programming is mainly an optimization over plain recursion. Wherever we see a recursive solution that has repeated calls for same inputs, we can optimize it using Dynamic Programming. The idea is to simply store the results of subproblems, so that we do not have to re-compute them when needed later.

Why Dynamic Programming?

Recursion and dynamic programming (DP) are very depended terms. You can not learn DP without knowing recursion.

Before getting into the dynamic programming lets learn about recursion.

Recursion

Recursion is a programming technique where programming function calls itself.

Every recursion functions consist of two parts.

  • code to execute in the recursive function
  • termination condition or base condition

Recursion is very useful when your programs need to be divided into multiple parts and output of the one part is depends on the output of the previous part.

Recursion risks to solve identical subproblems multiple times. This inefficiency is addressed and remedied by dynamic programming.

About

This repository contains the most important questions of dynamic programming and variations of each question so that it becomes easy to identify which approach is to applied in the given question.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published