void QuickSort(int *arr, int begin, int end)
{
if(begin >= end)
{
return;
}
int left = begin;
int right = end;
int key = arr[begin];
while(begin < end)
{
while(begin < end && arr[end] >= key)
{
--end;
}
arr[begin] = arr[end];
while(begin < end && arr[begin] <= key)
{
++begin;
}
arr[end] = arr[begin];
}
arr[begin] = key;
int div = begin;
QuickSort(arr, left, div - 1);
QuickSort(arr, div + 1, right);
}