Why learn knapsack?

Knapsack

  • 01
  • Unbounded

Solve problems using knapsack:

2 Coin Problems

Rod cutting problem

Stock Market Max Profit Problem

Max ribbon cut problem

……….

What is DP?

  • Overlapping sub problems
  • optimal substructure
  • 2^n -> m*n

What is Knapsack solution?

  • Pick every possible solution to find optimum solution
  • Store and use already solved problem results

0/1 Knapsack:

Problem Description:

--

--