Bubbling C # version

xiaoxiao2021-03-05  27

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/

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

New Post(0)