Top "Dynamic-programming" questions

Dynamic programming is an algorithmic technique for efficiently solving problems with a recursive structure containing many overlapping subproblems.

Good examples, articles, books for understanding dynamic programming

I can't figure out the principles of dynamic programming and I really do want it. DP is very powerful, it …

algorithm language-agnostic dynamic-programming
What's the difference between recursion, memoization & dynamic programming?

Possible Duplicate: Dynamic programming and memoization: top-down vs bottom-up approaches I have gone through a lot of articles on this …

algorithm recursion dynamic-programming memoization
Given a list of numbers and a number k, return whether any two numbers from the list add up to k

This question was asked in the Google programming interview. I thought of two approaches for the same: Find all the …

arrays algorithm time-complexity dynamic-programming subsequence
The minimum number of coins the sum of which is S

Given a list of N coins, their values (V1, V2, ... , VN), and the total sum S. Find the minimum number …

algorithm dynamic task dynamic-programming
Number of ways to add up to a sum S with N numbers

Say S = 5 and N = 3 the solutions would look like - <0,0,5> <0,1,4> <0,2,3> <0,3,2> <5,0,0> &…

algorithm sum dynamic-programming
Maximizing profit for given stock quotes

I was asked this question while interviewing for a startup and saw this again in the recent contest at Code …

algorithm recursion dynamic-programming
n steps with 1, 2 or 3 steps taken. How many ways to get to the top?

If we have n steps and we can go up 1 or 2 steps at a time, there is a Fibonacci relation …

algorithm dynamic-programming
Why is the knapsack problem pseudo-polynomial?

I know that Knapsack is NP-complete while it can be solved by DP. They say that the DP solution is …

language-agnostic complexity-theory dynamic-programming knapsack-problem
How is dynamic programming different from greedy algorithms?

In the book I am using Introduction to the Design & Analysis of Algorithms, dynamic programming is said to focus …

algorithm dynamic-programming greedy
Dynamic programming - Largest square block

I need to find the largest square of 1's in a giant file full of 1's and 0's. I know …

c matrix dynamic-programming