填空题

在长度为n的有序线性表中进行二分查找。在最坏的情况下,需要的比较次数为______。

【参考答案】

log2n
<上一题 目录 下一题>
热门 试题

填空题
算法的基本特征是可行性、确定性、______和拥有足够的情报。
单项选择题
下列程序的执行结果为 Private Sub Command1_Click() Dim FirStr As String FirSt= abcdef Print Pat(FirStr) End Sub Private Function Pat(xStr As String)As String Dim tempStr As String,strLen As Integer tempStr= strLen=Len(xStr) i=1 Do While i<=Len(xStr)-3 tempStr=tempStr+Mid(xStr,i,1)+Mid(xStr,strLen -i+1,1) i=i+1 Loop Pat=tempStr End Function
A.abcdef
B.afbecd
C.fedcba
D.defabc
相关试题
  • Cls
  • PaintStart = False
  • Case Else
  • PaintStart = True
  • Print