Top "Dynamic-programming" questions

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

How do you find the optimal assignment of pupils in classes?

23 pupils from level A, 24 from level B and 30 from level C need to be assigned into three classes. The classes …

algorithm dynamic-programming combinatorics mathematical-optimization linear-programming
Dynamic Programming: Why Knuth's improvement to Optimal Binary Search Tree O(n^2)?

This is Exercise 15.5-4 of Introduction to Algorithms, 3rd edition, which is about Knuth's improvement to the DP approach to …

algorithm binary-search-tree dynamic-programming
Codility - min average slice

I'm trying to find a solution to a codility question on minimum slice of a subarray, and I've devised a …

javascript algorithm dynamic-programming kadanes-algorithm
Counting heads - Dynamic Programming

Problem: Given integers n and k, along with p1,p2,..., pn; where pi ε [0, 1], you want to determine the probability of …

algorithm dynamic-programming recurrence
largest sum of contiguous subarray No Larger than k

For example, we have {2,2,-1}, when k = 0, return -1. when k = 3, return 3. This is even tricky because we have negative …

algorithm queue dynamic-programming binary-search kadanes-algorithm