试写出直接插入排序算法。

试写出直接插入排序算法。
【正确答案】:void InsertionSort(SqList &L){ //对顺序表L作直接插入排序 for(i=2;i<=L.length; ++i) if(L.ri].key