CSharpGL.SortingHelper.QuickSort C# (CSharp) Method

QuickSort() private static method

private static QuickSort ( IntPtr array, Comparer comparer, Stack stack ) : void
array System.IntPtr
comparer Comparer
stack Stack
return void
        private static unsafe void QuickSort(IntPtr array, Comparer<TemplateStructType> comparer, Stack<int> stack)
        {
            TemplateStructType* pointer = (TemplateStructType*)array.ToPointer();

            while (stack.Count > 0)
            {
                int start = stack.Pop();
                int end = stack.Pop();
                int index = QuickSortPartion(pointer, start, end, comparer);
                if (start < index - 1)
                {
                    stack.Push(index - 1); stack.Push(start);
                }
                if (index + 1 < end)
                {
                    stack.Push(end); stack.Push(index + 1);
                }
            }
        }

Same methods

SortingHelper::QuickSort ( IntPtr array, bool descending, Stack stack ) : void
SortingHelper::QuickSort ( IntPtr array, int start, int end, Comparer comparer ) : void
SortingHelper::QuickSort ( IntPtr array, int start, int end, bool descending ) : void