The insertion sort algorithm expressed in pseudocode - 插入排序

Computer Science An Overview _J. Glenn *shear _11th Edition

procedure Sort (List)

N ← 2;

while (the value of N does not exceed the length of List)do

(

        Select the Nth entry in List as the pivot entry;

        Move the pivot entry to a temporary location leaving a hole in List;

          while (there is a name above the hole and that name is greater than the pivot)

              do (move the name above the hole down into the hole leaving a hole above the name)

        Move the pivot entry into the hole in List;

N ← N + 1)

//pivot entry 主元项

上一篇:MATLAB中取整函数(fix, floor, ceil, round)的使用


下一篇:4 Values whose Sum is 0_upper_bound&&ower_bound