public class quickSort {
	//modify the tokens
    public static void main(String[] args) {
        int[] testttttttttt={49,38,65,97,76,13,27,49,78,34,12,64,1,8};
        for (int a = 0; a < testttttttttt.length; a++) {
            System.out.print(testttttttttt[a]+" ");
        }
        System.out.println();
        if(testttttttttt.length>0)
        	sort(testttttttttt,0,testttttttttt.length-1);
        for (int a = 0; a <testttttttttt.length;a++) {
            System.out.print(testttttttttt[a]+" ");
        }
    }

    public static void sort(int[] arrrrrrrrrrrrrrr, int l, int r) {
        if(l<r){ 
            int m = partition(arrrrrrrrrrrrrrr,l,r);
            sort(arrrrrrrrrrrrrrr, l, m-1);
            sort(arrrrrrrrrrrrrrr, m+1, r);
        }
    }

    private static int partition(int[] arrrrrrrrrrrrrrr, int l, int r) {
        int pivot = arrrrrrrrrrrrrrr[l];
        while(l<r){
            while(l<r && arrrrrrrrrrrrrrr[r]>=pivot){
                r--;
            }
            arrrrrrrrrrrrrrr[l] = arrrrrrrrrrrrrrr[r]; 
            while(l<r && arrrrrrrrrrrrrrr[l]<=pivot){
                l++;
            }
            arrrrrrrrrrrrrrr[r] = arrrrrrrrrrrrrrr[l];
        }
        arr[l] = pivot;
        return l;
    }
}