public void MajorityElementTest() { MajorityElements majorityElements = new MajorityElements(); int[] nums = new int[] { 3, 2, 3 }; int res = majorityElements.MajorityElement(nums); Assert.IsTrue(res == 3); }
private static void TestBoyerMoore() { Console.WriteLine(5 == MajorityElements.BoyerMoore(new [] { 1, 3, 5, 5, 5, 5, 4, 1, 5 })); }