int Binary_Search(S_T *t, KeyType kx)
{
int low,high,mid;
int flag;
low=1;
hight =t->length;
falg = 0;
while(low <= high)
{
mid=(low+high)/2;
if(kx < t->data[mid].key)
high=mid-1;
else
if(kx > t->data[mid].key)
low=mid+1;
else
{
flag=mid;
break;
}
}
return flag;
}
阅读(746) | 评论(0) | 转发(1) |