Top "Dynamic-programming" questions

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

kadane algorithm in java

I have the following implementation of Kadane's algorithm in java. It is basically to find the maximum sum of contiguous …

java algorithm dynamic-programming kadanes-algorithm
maximum sum of a subset of size K with sum less than M

Given: array of integers value K,M Question: Find the maximum sum which we can obtain from all K element …

algorithm data-structures dynamic-programming subset-sum clrs
Number of all longest increasing subsequences

I'm practicing algorithms and one of my tasks is to count the number of all longest increasing sub-sequences for given 0 &…

algorithm numbers dynamic-programming lis subsequence
0/1 Knapsack Dynamic Programming Optimazion, from 2D matrix to 1D matrix

I need some clarification from wikipedia: Knapsack, on the part This solution will therefore run in O(nW) time and …

algorithm optimization dynamic-programming knapsack-problem
Memoization or Tabulation approach for Dynamic programming

There are many problems that can be solved using Dynamic programming e.g. Longest increasing subsequence. This problem can be …

algorithm recursion time-complexity dynamic-programming
Length of longest subarray of sum less than or equal to k

In an interview I was asked this question: given some array of positive integers s, find the length of the …

python algorithm dynamic-programming
FSharp runs my algorithm slower than Python

Years ago, I solved a problem via dynamic programming: https://www.thanassis.space/fillupDVD.html The solution was coded in …

python algorithm performance f# dynamic-programming
Largest rectangular sub matrix with the same number

I am trying to come up with a dynamic programming algorithm that finds the largest sub matrix within a matrix …

algorithm matrix dynamic-programming
Finding all paths down stairs?

I was given the following problem in an interview: Given a staircase with N steps, you can go up with 1 …

c++ algorithm dynamic-programming
Generalised Two-Egg Puzzle

Here is the Problem Description : Suppose that we wish to know which stories in a N-story building are safe to …

algorithm puzzle dynamic-programming