C # Sort algorithm full contact

xiaoxiao2021-03-06  139

Bubble Sort:

The following is the bubble sorting algorithm developed by C #. I hope to bring some benefits to learners in C # language. Don't forget, learn the language to spend vigorous gas data structure and algorithm.

Using system; namespace bubblesorter {public void sort (int [] list) {INT i, J, TEMP; BOOL DONE = false; j = 1; while ((j list [i 1]) {done = false; temp = list [i]; List [i] = list [i 1]; list [i 1] = Temp;}} j ;}}} public class mainclass}} public class mainclass}} public class mainclass}}} public class mainclass}} public class main () {int [] IARRARY = new int [] {1, 5, 13, 6, 10, 55, 99, 2, 87, 12, 34, 75, 33, 47}; bubblesorter sh = new bubblesorter (); sh.sort (IARRARY); for (int m = 0; m

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

New Post(0)