#includeusing namespace std;int partition(int *a,int p,int r){ int x=a[r]; int i=p-1;//note i important which is used for //storage the number smaller than flag x=a[r] for (int j=p;j
import java.util.Scanner;public class QuickSort { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner scanner=new Scanner(System.in); int n=Integer.parseInt(scanner.next()); int a[]=new int[n]; for (int i = 0; i < a.length; i++) { a[i]=Integer.parseInt(scanner.next()); } quickSort(a, 0, n-1); for (int i = 0; i < a.length; i++) { System.out.print(a[i]+" "); } } public static void quickSort(int a[], int p, int e) { if (pvoid swap (T a, T b) {// T temp=b;// b=a;// a=temp;// }