试以L.r[k+1]作为监视哨改写教科书10.2.1节中给出的直接插入排序算法。.../endfor}//InsertSort
试以L.r[k+1]作为监视哨改写教科书10.2.1节中给出的直接插入排序算法。.../endfor}//InsertSort
理解下面算法,并补充完整。[br][/br] //算法功能:(1) public void insertSort() { int temp, position; for (int i = 1; i [ length; (2) ) { temp = record[i]; for (position = i; position ] 0 && temp < record[position -1]; (3) ) { record[position] = record[position - 1]; } record[position] = (4) ; } }[/i]
理解下面算法,并补充完整。[br][/br] //算法功能:(1) public void insertSort() { int temp, position; for (int i = 1; i [ length; (2) ) { temp = record[i]; for (position = i; position ] 0 && temp < record[position -1]; (3) ) { record[position] = record[position - 1]; } record[position] = (4) ; } }[/i]
1