A C # version of the bubbling ordering method

xiaoxiao2021-03-06  63

From small to big sorting int [] myarray = new int [] {10, 8, 3, 5, 6, 7, 4, 6, 9}; int Len = myarray.length; // 外,, only cycle array.length - 1 FOR (INT i = 0; I MyArray [i 1], then MyArray [i 1] float One IF (MyArray [J]) {Int Temp = MyArray [J]; MyArray [J] = MyArray [J 1]; MyArray [J 1] = Temp;}}}

From large to small, int [] myarray = new int [] {10, 8, 3, 5, 6, 7, 4, 6, 9}; // Take the length of the longest phrase - bubbling force for (int) J = 1; j

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

New Post(0)