问题
问答题
下面程序实现插入排序算法。typedef struct{ int key; Info otherinfo;}SeqList;void InsertSort(SeqList R[],int n){/* 待排序列保存在R[1..n]中*/SeqList x; int i,j,k,lo,hi,mi; for (i=2;i<=n;i++){ (1);lo=1;hi=i-l; while (lo<=hi) { mi=(lo+hi)/2; if ((2)) break; if (R[mi].key>x.key) hi=mi-l; else lo=mi+l;}if (mi=lo) k=i - mi;else k=i - mi-1;for (j=0;j
答案
参考答案: