Example #1
0
        public void TestMaxProfit(int[] nums, int expectedMaxValue)
        {
            var problems = new DynamicProgrammingProblems();

            var actualMaxValue = problems.MaxProfit(nums);

            Assert.Equal <int>(expectedMaxValue, actualMaxValue);
        }
Example #2
0
        public void TestLongestPalindrome(string s, string expectedValue)
        {
            var problems = new DynamicProgrammingProblems();

            var actualValue = problems.LongestPalindrome(s);

            Assert.True(expectedValue.Equals(actualValue));
        }
Example #3
0
        public void TestMaxSubArray(int[] nums, int expectedValue)
        {
            var problems = new DynamicProgrammingProblems();

            var actualValue = problems.MaxSubArrayGreedy(nums);

            Assert.Equal <int>(expectedValue, actualValue);
        }
Example #4
0
        public void TestFibonacciConstantSpace(int n, ulong expectedValue)
        {
            var problems = new DynamicProgrammingProblems();

            var actualValue = problems.FibonnaciWithConstantSpace(n);

            Assert.Equal <ulong>(expectedValue, actualValue);
        }