1顺序查找#include #define MAXLEN 100typedef struct element int key;typedef struct element SqListMAXLEN; /数组从 0 开始,0 保留不用:符合习惯/及岗哨法int SqSrch(SqList r,int k,int n) /k:目标值/ 键值,n 为元素个数int i;r0.key =k;i=n;while(ri.key!=k)i-;return(i);/主程序void main()SqList a=0,11,15,3,9,6,5,7;int k=5,i;for(i=1;i=7;i+)printf(“%3d“,ai);printf(“n“);i=SqSrch(a,k,7);if(i=0)printf(“查不到该记录!n“);elseprintf(“%d 该记录数组下标为%dn“,k,i);