Top "Dynamic-programming" questions

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

Implementing Text Justification with Dynamic Programming

I'm trying to understand the concept of Dynamic Programming, via the course on MIT OCW here. The explanation on OCW …

algorithm python-3.x dynamic-programming
Maximal value among shortest distances in a matrix

I am trying to solve the following problem and have not been able to develop an algorithm or approach. I …

algorithm matrix graph dynamic-programming shortest-path
Is there a generic way to memoize in Scala?

I wanted to memoize this: def fib(n: Int) = if(n <= 1) 1 else fib(n-1) + fib(n-2) println(fib(100)) // times …

scala scope dynamic-programming memoization forward-reference
Finding maximum size sub-matrix of all 1's in a matrix having 1's and 0's

Suppose you are given an mXn bitmap, represented by an array M[1..m,1.. n] whose entries are all 0 or 1. A …

algorithm dynamic-programming
Optimal room count and sizes for N overlapping Meeting Schedules

I bumped into this question and I am not sure if my solution is optimal. Problem Given N weighted (Wi) …

algorithm scheduling dynamic-programming intervals greedy
How to count integers between large A and B with a certain property?

In programming contests, the following pattern occurs in a lot of tasks: Given numbers A and B that are huge (…

algorithm dynamic-programming
Finding the Longest Palindrome Subsequence with less memory

I am trying to solve a dynamic programming problem from Cormem's Introduction to Algorithms 3rd edition (pg 405) which asks the …

algorithm language-agnostic dynamic-programming palindrome
Recursive change-making algorithm

Given a target amount and a list of coin denominations, my code is supposed to find the fewest coins needed …

python algorithm recursion dynamic-programming coin-change
Dynamic programming approach to TSP in Java

I'm a beginner, and I'm trying to write a working travelling salesman problem using dynamic programming approach. This is the …

java dynamic-programming traveling-salesman
Number of n-element permutations with exactly k inversions

I am trying to efficiently solve SPOJ Problem 64: Permutations. Let A = [a1,a2,...,an] be a permutation of integers 1,2,...,n. …

algorithm permutation dynamic-programming combinatorics discrete-mathematics