CSharpGL.SortingHelper.QuickSortPartion C# (CSharp) Метод

QuickSortPartion() приватный статический Метод

private static QuickSortPartion ( TemplateStructType array, int start, int end, Comparer comparer ) : int
array TemplateStructType
start int
end int
comparer Comparer
Результат int
        private static unsafe int QuickSortPartion(TemplateStructType* array, int start, int end, Comparer<TemplateStructType> comparer)
        {
            TemplateStructType pivot, startValue, endValue;
            pivot = array[start];
            while (start < end)
            {
                startValue = array[start];
                while (start < end && comparer.Compare(startValue, pivot) > 0)
                {
                    start++;
                    startValue = array[start];
                }

                endValue = array[end];
                while (start < end && comparer.Compare(endValue, pivot) < 0)
                {
                    end--;
                    endValue = array[end];
                }

                if (start < end)
                {
                    array[end] = startValue;
                    array[start] = endValue;
                }
            }

            return start;
        }

Same methods

SortingHelper::QuickSortPartion ( TemplateStructType array, int start, int end, bool descending ) : int