Quick Sort Method:
public class Main {public static void Main (string[] args) {int a[]={7,8,1,3,5}; New Main (a); Public Main (int[] a) {System.out.println ("before sorting:"); Print (a); QuickSort (a,0,a.length-1); System.out.println (); System.out.println ("After sorting:"); Print (a); } public int Getmiddle (int[] list,int low,int high) {int temp=list[low];//array first as the middle axis while (LOW&L T;high) {while (Low < high && list[high]>=temp) high--; The number of list[low]=list[high];//is smaller than the middle axis and moved to the low side while (lower < high && list[low]<=temp) low++; The list[high]=list[low];//is larger than the middle axis and moves to the high end of the list[low]=temp;//axis recorded to the tail//SYSTEM.OUT.PRINTLN ("low== High? "+ (Low==high) +" low= "+low+" high= "+high); Return low;//returns the position of the axis//To determine that the last three axes are 3 2 0} public void QuickSort (int. a[],int Low,int High) {if (lo WThis algorithm should be done at the fingertips. Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Quick Sort Method QuickSort---Java