# include<iostream>
# include<math.h>
using namespace std;
typedef int Elemtype;
typedef struct {
Elemtype *elem;
int TableLen;
}SSTable,SeqList;
int Search_Seq(SSTable &ST,Elemtype key){
for(int i=1;i<=ST.TableLen;i++){
if(ST.elem[i]==key)
return i;
}
return -1;
}
int Binary_search(SeqList &L,Elemtype key){
int low = 0,high = L.TableLen - 1,mid;
while(low<=high){
mid = (low+high)/2;
if(L.elem[mid]==key)
return mid;
else if(L.elem[mid] > key)
high = mid - 1;
else
low = mid + 1;
}
return -1;
}
08-15
2108
12-14
3273
09-07
2658
01-10
1万+
08-10
7065
05-26
08-22
08-06