Category: DP

Maximum Product Rod Cutting

Given a rod of length n, find the optimal way to cut rod into smaller rods in order to maximize product of price of each of the smaller rod. Assume each rod of length i has price i.

Rod Cutting

Given a rod of length n and list of prices of rod of length i where 1 < = i

Minimum Sum Partition problem

Given a set of positive integers S, partition the set S into two subsets S1, S2 such that the difference between the sum of elements in S1 and the sum of elements in S2 is minimized.

Subset sum problem

Given a set of positive integers and an integer s, is there any non-empty subset whose sum to s.

Partition problem

Given a set of positive integers, find if it can be divided into two subsets with equal sum.

Maximize value of the expression

Given an array A, maximize value of the expression (A[s] – A[r] + A[q] – A[p]) where l, k, j and i are indexes of the input array and s > r > q > p.

0-1 Knapsack problem

Given a set of items, each with a weight and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible. Items are indivisible; you either take an item or …