static int partition(int []arr, int low,
for (int j = low; j < high; j++)
static void quickSort(int []arr, int low, int high)
int pi = partition(arr, low, high);
quickSort(arr, low, pi-1);
quickSort(arr, pi+1, high);
static void printArray(int []arr, int n)
for (int i = 0; i < n; ++i)
Console.Write(arr[i] + " ");
public static void Main()
int []arr = {1, 7, 8, 9, 1, 5};
Console.WriteLine("sorted array ");