Import Java.util.scanner;import Java.util.arraylist;public class Paixu2{public int[] alist;//quick sort public static void Main (String args[]) {Paixu2 he=new Paixu2 (); He.setup (); He.look (); He.go (0,9); He.look ();} public void Setup () {Scanner sc=new Scanner (system.in); alist=new int[10];for (int i=0;i<10;i++) {Alist[i]=sc.nextint ();}} public void Look () {System.out.println (""), for (int i=0;i<10;i++) {System.out.print (alist[i]);}} public void Change (int i,int j) {int tempp;tempp=alist[i];alist[i]=alist[j];alist[j]=tempp;} public void Go (int i,int j) {if (i>j) {return;} int S=i;int pointi=i;int Pointj=j;while (Pointj!=pointi) {while (pointj>pointi&&alist[pointj]>=alist[s ]) {pointj--;} while (Pointj>pointi&&alist[pointi]<=alist[s]) {pointi++;} if (pointj>pointi) {change (POINTI,POINTJ);}} Change (S,POINTJ); go (i,pointi-1); go (pointi+1,j);}}
Quickly sort Java code