Ishan-sinha / 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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

License:MIT License


Languages

Language:Java 88.2%Language:C++ 6.1%Language:Python 5.7%