Data structure routine version

xiaoxiao2021-03-13  180

Public class sORTER {public void bubblesort (int [] list) // bubbling {INT I, J, TEMP; J = 1; While (j list [i 1]) {temp = list [i]; list [i] = list [i 1]; list [i 1] = temp;} } J ;}} public void select} // Select sort {INT I, J, TEMP; for (i = 0; i list [j]) {temp = list [i]; list [i] = list [j]; list [j] = temp;}}} PUBLIC VOID INSERTIONSORT (int [] list) // Insert {for (INT i = 1; i 0) && (list [j-1]> temp)) {list [ j] = list [j-1]; j -;} list [j] = TEMP;}} public void shellsort (int [] list) // Hill sort {INT INC; for (INC = 1; INC < = list.Length / 9; INC = 3 * inc 1); for (; inc> 0; inc / = 3) {for (int i = inc 1; i <= list.length; i =

INC) {INT TEMP = List [I-1]; INT J = I; While ((j> inc) && (list [j-incap "> TEMP) {list [j-1] = list [J -inc-1]; j- = inc;} list [j-1] = Temp;}}}} has a good data structure website http://student.zjzk.cn/course_ware/data_structure/web/main .htm

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

New Post(0)