low 指示查找区间的下界
high 指示查找区间的上界
mid = (low+high)/2
int Search_Bin ( SSTable ST, KeyType key )
{
low = 1;
high = ST.length; // 置区间初值
while (low <= high)
{
mid = (low + high) / 2;
if (EQ (key , ST.elem[mid].key) ) return mid; // 找到待查元素
else if ( LT (key , ST.elem[mid].key) ) high = mid - 1; // 继续在前半区间进行查找
else low = mid + 1; // 继续在后半区间进行查找
}
return 0; // 顺序表中不存在待查元素
}