コード例 #1
0
        public void MaxProfitOnePass_Returns_ExpectedResults(int[] prices, int expected)
        {
            var actual = BestTimeToBuyAndSellStock2.MaxProfitOnePass(prices);

            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
        public void MaxProfitPeakValleyApproach_Returns_ExpectedResults(int[] prices, int expected)
        {
            var actual = BestTimeToBuyAndSellStock2.MaxProfitPeakValleyApproach(prices);

            Assert.AreEqual(expected, actual);
        }
コード例 #3
0
 public int MaxProfitPeakValleyApproach() => BestTimeToBuyAndSellStock2.MaxProfitPeakValleyApproach(Prices);
コード例 #4
0
 public int MaxProfitOnePass() => BestTimeToBuyAndSellStock2.MaxProfitOnePass(Prices);
コード例 #5
0
 public int MaxProfitBruteForce() => BestTimeToBuyAndSellStock2.MaxProfitBruteForce(Prices);