コード例 #1
0
        static void TestTwoSum()
        {
            var numbers = new int[] { 2, 7, 11, 15 };

            var result = HashTableExercises.TwoSum(numbers, 9);

            foreach (var index in result)
            {
                Console.Write(index + " ");
            }
        }
コード例 #2
0
        static void TestCountPairsWithDiff()
        {
            var numbers = new int[] { 1, 7, 5, 9, 2, 12, 3 };

            Console.WriteLine(HashTableExercises.CountPairsWithDiff(numbers, 2));
        }
コード例 #3
0
        static void TestMostFrequent()
        {
            var numbers = new int[] { 1, 2, 2, 3, 3, 3, 4 };

            Console.WriteLine(HashTableExercises.MostFrequent(numbers));
        }