待排序记录的数据类型定义如下:
#define MAXSIZE 100
typedef int KeyType;
typedef struct{
KeyType key;
}RecType;
typedef RecType SeqList[MAXSIZE];
下列函数f32()的功能是用直接插入排序对顺序表按升序进行排序,请在空白处填上适当内容使算法完整。
void f32(SeqList R,int n)
{int i,j;
RecType temp;
for(i=1;i<=n-1;i++)
{temp=R[i];
___(1)___;
while(j>0&&___(2)___)
{R[j]=R[j-1];
____(3)__;
}
R[j]=temp;
}
return;
}