Java rapid sort function

xiaoxiao2021-03-06  116

Www.edonkey2000.cn ============================================= =========== Void Quicksort (String [] PDATA, INT [] PDATANUM, INT LEFT, INT Right) {INT I, J; INT ITEMP; String Middle, Strtemp; I = Left; J = Right; Middle = PDATA [(Left Right) / 2]; Do {while ((PDATA [i] .compareto (Middle) <0) && (i 0 && (j> left)) J -; IF (i <= j) {straTemp = PDATA [I]; PDATA [i] = pdata [j]; pdata [j] = strTemp; itemp; itemp; itemp = PDATANUM [I]; PDATANUM [i] = pdatanum [j]; pdatanum [j] = itemp; i ; j -;}} while (i <= j); // If the subscript of the two sides is interlaced, Stop (complete once)

IF (Left

IF (Right> i) Quicksort (PDATA, PDATANUM, I, RIGHT);

转载请注明原文地址:https://www.9cbs.com/read-99531.html

New Post(0)