/ ***
Title: Quick Sorting P> *
Description: * Quick Sort is one of the fastest rankings (depending on the object of the subject), * Although the rapid sorting method can reach O (N2) under the worst state, in most cases, the efficiency performance of the rapid sorting method is quite good. * The basic spirit of the rapid sorting method is to find the appropriate axis in the plurality of columns, and then divide the number one to two. Sort the left and the right number, which affects the efficiency of the rapid ordering method. Selection. * P> *
Copyright: Copyright (c) 2006 p> *
Company: p> * @Author NOT Attributable * @version 1.0 * / public class quicksort {
Public static void print (int [] number) {// Print input array content for (int i = 0; i Public static void swap (int [] number, int i, int j) {// exchange Number array index i, value INT TMP; TMP = Number [i]; Number [i] = number [J]; Number [J] = TMP;} / ** * Fast Sort by the left element * Solution: * 1. Set the leftmost number to the axis, and record its value as S * 迴 process: * 2. Order index i from the number column left to the right, until the number greater than S is found * 3. Let the index j look forward from the number of numbers to the left, until the number of less than s * 4. If i> = j, leave the loop * 5. If i * @Param Number Sort Array * @Param LEFT Start Index * @Param Right End Index * / Public Static Void Sort (int [] Number, INT LEFT, INT RIGHT) {IF (Left * @Param Number * @Param Left * @Param Right * / Public Static Void Sort1 (int [] Number, int LEFT, INT Right) {if (Left