📄 seqsearch.c
字号:
#include <stdio.h>
#define seqListDataSize 50
typedef seqListDataType int
typedef struct
{
recordDataType element[recordDataSize];
int length;
}seqList
int serchSeqList(seqList *l,seqListDataType key)
{
l.element[0]=key;
i=l.length;
while(l.element[i]!=key)
i--;
return i;
}
int binSerchSeqList(seqList *l,seqListDataType key)
{
int low,high,mid;
low=1;
high=l.length;
while(low<=high)
{
mid=(low+high)/2;
if(key==l.element[mid])
return mid;
if(key>l.element[mid])
low=mid+1;
else
high=mid-1;
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -