X
xiaoshun
Unregistered / Unconfirmed
GUEST, unregistred user!
function BinarySearch(A:string
low:integer
high:integer
k:string ):integer;
var i:integer;
begin
if high<> 0 then
begin
while (low<=high) do
begin
i := high div 2;
if A= k then
result:= i
else if A > k then
high:=i-1
else if A < k then
low:=low+1
end;
end
else
showmessage('请输入数据后再查找');
end;
low:integer
high:integer
k:string ):integer;
var i:integer;
begin
if high<> 0 then
begin
while (low<=high) do
begin
i := high div 2;
if A= k then
result:= i
else if A > k then
high:=i-1
else if A < k then
low:=low+1
end;
end
else
showmessage('请输入数据后再查找');
end;