import java.util.Comparator;import java.util.PriorityQueue;public class solution2 { public static void main(String[] args) { // TODO Auto-generated method stub int A[] = {3,4,6,3,5,33,8,6,4,3,2,1,4,0,3}; quickSort(A,0,A.length-1); for(int i : A){ System.out.println(i); } } public static void quickSort(int[] array, int p, int r) { if (p < r) { int q = partion(array, p, r); quickSort(array, p, q - 1); quickSort(array, q + 1, r); } } private static int partion(int[] n, int start, int end) { int tmp = n[start]; while (start < end) { while (n[end] >= tmp && start < end) end--; if (start < end) { n[start++] = n[end]; } while (n[start] < tmp && start < end) start++; if (start < end) { n[end--] = n[start]; } } n[start] = tmp; return start; }}