public void KnapsackDiscreteNoRepeatTest() { var W = 10; var n = 3; var weights = new int[] { 1, 4, 8 }; var dynamicProgramming = new DynamicProgramming(); Console.WriteLine(dynamicProgramming.DiscreteKnapsackNoRepeats(W, weights, n)); }
public void DiscreteKnapsackTest() { var W = 10; var weights = new long[] { 6, 3, 4, 2 }; var values = new long[] { 30, 14, 16, 9 }; var dynamicProgramming = new DynamicProgramming(); Console.WriteLine(dynamicProgramming.DiscreteKnapsack(W, weights, values)); }
public void RecursiveChangeTest() { var money = int.Parse(Console.ReadLine()); var coinsInput = Console.ReadLine().Split(' '); var coins = new long[coinsInput.Length]; for (var i = 0; i < coins.Length; i++) { coins[i] = long.Parse(coinsInput[i]); } var dynamicProgramming = new DynamicProgramming(); Console.WriteLine(dynamicProgramming.RecursiveChange(money, coins)); }
public void PrimitiveCalculatorTest() { var dynamicProgramming = new DynamicProgramming(); dynamicProgramming.PrimitiveCalculator(96234); }