public class IntQuickSort
{
private static int Split(int[] data,int low,int high)
{
if(data == null) throw new ArgumentException();
if(low<0 || high >= data.length) throw new ArgumentOutOfRangeException();
int pivot= data[low];
while(low<high)
{
while(low<high && data[high] >= pivot) high--;
data[low] = data[high];
while(low<high && data[low] <= pivot) low++;
data[high] = data[low];
}
data[low] = pivot;
return low;
}
//recursion quick sort
public static void QuickSort(int[] data,int low,int high)
{
int pivot= Split(data,low,high);
QuickSort(data,low,pivot-1);
QuickSort(data,pivot+1,high);
}
}