待查找记录的数据类型定义如下。#define MAXSIZE 100typedef int KeyType;typedef st

待查找记录的数据类型定义如下。
#define MAXSIZE 100
typedef int KeyType;
typedef struct{
KeyType key;
}RecType;
typedef RecType SeqList[MAXSIZE];
下列算法实现对按升序排列的数据进行二分查找。请在空白处填上适当内容使算法完整。
int BinSearch(SeqList R,KeyType k,int n)
{int low=0,high=n-1,mid;
while(low<=high)
{mid=(low+high)/2;
if((___(1)___))return mid;
else if(R[mid].key> k) high=___(2)___;
else low=___(3)___;
}
return-1;
}
【正确答案】:(1)R[mid].key==k
(2)mid-1
(3)mid+1