public void TestMaxProfit(int[] nums, int expectedMaxValue) { var problems = new DynamicProgrammingProblems(); var actualMaxValue = problems.MaxProfit(nums); Assert.Equal <int>(expectedMaxValue, actualMaxValue); }
public void TestLongestPalindrome(string s, string expectedValue) { var problems = new DynamicProgrammingProblems(); var actualValue = problems.LongestPalindrome(s); Assert.True(expectedValue.Equals(actualValue)); }
public void TestMaxSubArray(int[] nums, int expectedValue) { var problems = new DynamicProgrammingProblems(); var actualValue = problems.MaxSubArrayGreedy(nums); Assert.Equal <int>(expectedValue, actualValue); }
public void TestFibonacciConstantSpace(int n, ulong expectedValue) { var problems = new DynamicProgrammingProblems(); var actualValue = problems.FibonnaciWithConstantSpace(n); Assert.Equal <ulong>(expectedValue, actualValue); }