The average successful search time taken by binary search on a sorted array of 10 items is
A. | 2.6 |
B. | 2.7 |
C. | 2.8 |
D. | 2.9 |
Answer : D Explanation : The 10 items i1, i2, ..., i10 may be arranged in a binary search trees as in Fig To get i5, the number of comparision needed is 1; for i2, it is 2; for i8 it is 2; for i1 it is 3, and so on. The average is (1+(2+2) +(3+3+3+3)+(4+4+4))/10, i.e., 2.9.
|
|
Option: A Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. |