• 2021-04-14 问题

    试以L.r[k+1]作为监视哨改写教科书10.2.1节中给出的直接插入排序算法。.../endfor}//InsertSort

    试以L.r[k+1]作为监视哨改写教科书10.2.1节中给出的直接插入排序算法。.../endfor}//InsertSort

  • 2022-06-15 问题

    理解下面算法,并补充完整。[br][/br] //算法功能:(1) public void insertSort() { int temp, position; for (int i = 1; i &#91; length; (2) ) { temp = record[i]; for (position = i; position &#93; 0 && temp < record&#91;position -1&#93;; (3) ) { record&#91;position&#93; = record&#91;position - 1&#93;; } record&#91;position&#93; = (4) ; } }[/i]

    理解下面算法,并补充完整。[br][/br] //算法功能:(1) public void insertSort() { int temp, position; for (int i = 1; i &#91; length; (2) ) { temp = record[i]; for (position = i; position &#93; 0 && temp < record&#91;position -1&#93;; (3) ) { record&#91;position&#93; = record&#91;position - 1&#93;; } record&#91;position&#93; = (4) ; } }[/i]

  • 1