Interview Bootcamp

0% completed

What is Dynamic Programming?

Dynamic Programming (DP) is an algorithmic technique for solving an optimization problem by breaking it down into simpler subproblems and utilizing the fact that the optimal solution to the overall problem depends upon the optimal solution to its subproblems.

Let's take the example of the Fibonacci numbers. As we all know, Fibonacci numbers are a series of numbers in which each number is the sum of the two preceding numbers. The first few Fibonacci numbers are 0, 1, 1, 2, 3, 5, and 8, and they continue on from there.

.....

.....

.....

Like the course? Get enrolled and start learning!
A

Adam Sweeney

· 4 years ago

The C++ code is doing a lot of pointless stuff. A virtual function, why? Heap allocating the functor, again, why? It should have just been a free function.

Show 1 reply
Ankit Joshi

Ankit Joshi

· a year ago

DP is most important pattern in Interviews but this section is very small with only 1 type of problem, i know there exist separate course for DP but this course is meant to over all coding patterns.

F

Flash

· 4 years ago

How do we calculate runtime/spactime complexity for recusive problems?

Show 1 reply
John Snow

John Snow

· a year ago

in the top-down memorize approach you have an example to cache overlapping problems which processed in the calculateFibonacci method.

Could you clarify why you initiated a memoize array with length is n + 1 instead of n?

Thank you for your support!

Show 1 reply