Public class qsort {/*** @ author ganjh 2010-08-09 * @ Param pdata the position on the left of the array to be sorted * @ Param left. The initial value is 0 * @ Param right, the initial value is the array length */public static void quicksort (INT [] pdata, int left, int right) {int I, j; int middle, temp; I = left; j = right; middle = pdata [left]; while (true) {While (++ I) <right-1 & pdata [I] <middle ); // start from the second element on the left and find the element while (-- j)> left & pdata [J]> middle) that is larger than middle ); // start from the first element on the right and find If (I> = J) element smaller than middle // when I is less than J, the break of the two elements is exchanged; temp = pdata [I]; pdata [I] = pdata [J]; pdata [J] = temp;} // The meaning of the following two sentences: pdata [left] And pdata [J, in this way, an array centered on pdata [J] is formed. The element with a subscript smaller than // J is smaller than pdata [J], and the element with a subscript greater than J is larger than pdata [J. Pdata [left] = pdata [J]; pdata [J] = middle; // call the recursive if (left <j) quicksort (pdata, left, J); // call recursive if (Right> I) quicksort (pdata, I, right) for the elements on the Right of pdata [J );} public static void main (string [] ARGs) {int [] pdata = new int [10]; for (INT I = 0; I <10; I ++) pdata [I] = (INT) (math. random () * 100); For (INT I = 0; I <pdata. length; I ++) system. out. print (pdata [I] + ""); qsort. quicksort (pdata, 0, pdata. length); system. out. println ("\ n ***********************"); For (INT I = 0; I <pdata. length; I ++) system. out. print (pdata [I] + "");}}