Written by: zzy2740
Public void bubblesort (int [] r) {INT i, J, TEMP; // exchange flag BOOL Exchange; // Make up R.LENGTH-1 排 (i = 0; i = i; j--) {// exchange condition IF (R [J 1] < R [j]) {TEMP = R [J 1]; R [J 1] = R [J]; R [J] = Temp; // Have exchange, the exchange flag is true Exchange = true ;}} // This slap has not exchanged, and the algorithm if (! Exchange) {Break;}}}
Author Blog:
http://blog.9cbs.net/zzy2740/