Beispiel #1
0
        private void RunTwo(MinXor minXor)
        {
            Console.WriteLine("Elements of Two =====================");
            int[] values;
            int   min;

            values = new int[] { 3, 10, 5, 25, 2, 8 };
            min    = minXor.FindTwo(values);
            Console.WriteLine($"The min xor of {string.Join(",", values)} is {min}");

            values = new int[] { 3, 10, 5, 25 };
            min    = minXor.FindTwo(values);
            Console.WriteLine($"The min xor of {string.Join(",", values)} is {min}");

            values = new int[] { 3, 10, 5 + 16, 25 };
            min    = minXor.FindTwo(values);
            Console.WriteLine($"The min xor of {string.Join(",", values)} is {min}");

            values = new int[] { 16 + 3, 16 + 10, 16 + 5, 25 };
            min    = minXor.FindTwo(values);
            Console.WriteLine($"The min xor of {string.Join(",", values)} is {min}");

            values = new int[] { 10, 2, 8 };
            min    = minXor.FindTwo(values);
            Console.WriteLine($"The min xor of {string.Join(",", values)} is {min}");
        }
Beispiel #2
0
        public void Run()
        {
            Console.WriteLine("Xor =====================");
            MinXor minXor = new MinXor();

            RunTwo(minXor);
        }