问题 单项选择题

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

A.O(n)

B.O(n2)

C.O(log2n)

D.O(nlog2n)

答案

参考答案:C

解析: 对于长度为n的有序线性表,在最坏情况下,二分法查找只需比较log2n次,而顺序查找需要比较n次。

单项选择题
单项选择题

When a disease of epidemic proportions threatens the public, scientists immediately get to work, trying to locate the source of affliction and find ways to combat. Vaccination is one of the effective ways to protect the (1) population of a region or country which may be (2) grave risk. The process of vaccination allows the patient’s body to (3) immunity to the virus or disease so that, if it is encountered, one can fight it (4) naturally. To accomplish this, a small weak or dead (5) of the disease is actually injected into the patient in a controlled environment, (6) his body’s immune system can learn to fight the invader (7) . Information (8) how to penetrate the disease’s defenses is (9) to all elements of the patient’s immune system in a process that occurs naturally, in which genetic information is passed from cell to cell. This makes sure that (10) the patient later come into contact with the real problem, his body is well equipped and trained to (11) with it, having already done so before.

There are, however, dangers (12) in the process. (13) , even the weakened version of the disease contained in the vaccine proves (14) much for the body to handle, resulting in the immune system (15) , and, therefore, the patient’s death. Such is the case of the smallpox vaccine, (16) to eradicate the smallpox epidemic that nearly (17) the whole Native American population and killed massive numbers of settlers. (18) 1 in 10,000 people who receive the vaccine (19) the smallpox disease from the vaccine itself and dies from it. Consequently, the process, which is truly a (20) , may indeed hide some hidden curses.

12()

A.available

B.plausible

C.accessible

D.inherent