Beispiel #1
0
        public int Compare(int[] a, int[] b)
        {
            int minA = SortingQueries.FindMinElement(a);
            int minB = SortingQueries.FindMinElement(b);

            if (minA < minB)
            {
                return(1);
            }
            if (minA > minB)
            {
                return(-1);
            }
            return(0);
        }
Beispiel #2
0
        public int Compare(int[] a, int[] b)
        {
            int maxA = SortingQueries.FindMaxElement(a);
            int maxB = SortingQueries.FindMaxElement(b);

            if (maxA > maxB)
            {
                return(1);
            }
            if (maxA < maxB)
            {
                return(-1);
            }
            return(0);
        }
Beispiel #3
0
        public int Compare(int[] a, int[] b)
        {
            int sumA = SortingQueries.FindSumOfElements(a);
            int sumB = SortingQueries.FindSumOfElements(b);

            if (sumA < sumB)
            {
                return(1);
            }
            if (sumA > sumB)
            {
                return(-1);
            }
            return(0);
        }