题库 高中信息

题干

在已排序的数组d[数组元素d(1)≥d(2)≥…≥d(n)]中查找键值为Key的数,其对分查找的VB程序段如下:
i=1:j=n
xb=0
Do While i<=j
m=Fix((i+j)/2)
If d(m)=Key Then
xb=m
Exit Do
End If
If d(m)>Key Then
①____
Else
②____
End If
Loop
划线处的语句为(  )
A.①j=m+1 ②i=m+1B.①i=m-1 ②j=m-1
C.①j=m-1 ②i=m+1D.①i=m+1 ②j=m-1
上一题 下一题 0.99难度 填空题 更新时间:2017-03-01 07:07:25

答案(点此获取答案解析)