Beispiel #1
0
        public void Test9()
        {
            var algorithm = new ParitySortAlgorithm();

            int[] result = algorithm.SortByParity(new int[] { 10, 2, 2, 6 });
            Assert.Equal(new int[] { 2, 2, 6, 10 }, result);
        }
Beispiel #2
0
        public void Test7()
        {
            var algorithm = new ParitySortAlgorithm();

            int[] result = algorithm.SortByParity(new int[] { 1, 3, 2, 4 });
            Assert.Equal(new int[] { 2, 4, 1, 3 }, result);
        }
Beispiel #3
0
        public void Test1()
        {
            var algorithm = new ParitySortAlgorithm();

            int[] result = algorithm.SortByParity(new int[] { 0 });
            Assert.Equal(new int[] { 0 }, result);
        }
Beispiel #4
0
        public void Test14()
        {
            var algorithm = new ParitySortAlgorithm();

            int[] result = algorithm.SortByParity(new int[] { 2, 8, 10, 12, 16, 52, 3, 5, 7, 9, 11, 17 });
            Assert.Equal(new int[] { 2, 8, 10, 12, 16, 52, 3, 5, 7, 9, 11, 17 }, result);
        }