问题
单项选择题
在长度为n的有序线性表中进行二分查找,需要的比较次数为( )。
A.log2n
B.nlog2n
C.n/2
D.(n+1)/2
答案
参考答案:A
解析: 在长度为n的有序线性表中进行二分查找,需要的比较次数为log2(下标)n。
在长度为n的有序线性表中进行二分查找,需要的比较次数为( )。
A.log2n
B.nlog2n
C.n/2
D.(n+1)/2
参考答案:A
解析: 在长度为n的有序线性表中进行二分查找,需要的比较次数为log2(下标)n。
A man and his friend were walking through the deser(沙漠). During the trip they had a ___and the man hit his friend in the face. His friend was hurt, but without saying ____, he wrote in the sand, “Today my best friend hit me in the face.” They ____ on walking until they found a lake, where they decided to take a bath. The man’s friend fell into the lake and was in danger, but the man saved him. After he came back to life, he wrtoe on a ______ : “Today my best friend saved my life.” The man who had hit and ___his best friend asked, “______ I hurt you, you wrote in the sand and now , you wrote on a stone. Why?” His friend _____, “When someone hurts us, we should write it down in sand where wind can ____ it away. ___, when someone does something good for us, we must write it down in stone where it can ______ for ever.”
|