public void GetMaxAreaTest() { int[] hist = { 6, 2, 5, 4, 5, 1, 6 }; int maxArea = Batch1.GetMaxArea(hist); Assert.AreEqual(12, maxArea); int[] hist2 = { 1, 2, 3, 4, 5 }; maxArea = Batch1.GetMaxArea(hist2); Assert.AreEqual(9, maxArea); }
public void GenerateParentheseTest() { int numPar = 3; Batch1.GenerateParenthese(numPar); // expected the following results // ((())) // (()()) // (())() // ()(()) // ()()() }
public void LengthOfLongestSubstringTest() { string s = "abcddcba"; int len; len = Batch1.LengthOfLongestSubstring(s); Assert.AreEqual(4, len); s = "abcdkmcbha"; len = Batch1.LengthOfLongestSubstring(s); Assert.AreEqual(7, len); }
public void NextPermutationTest() { int[] org = { 5, 6, 9, 8, 5, 4, 4, 1 }; int[] nextArray = Batch1.NextPermutation(org); }