Skip to content
Related Articles

Related Articles

ISRO | ISRO CS 2014 | Question 28
  • Last Updated : 14 May, 2018

Suppose there are 11 items in sorted order in an array. How many searches are required on the average, if binary search is employed and all searches are successful in finding the item?
(A) 3.00
(B) 3.46
(C) 2.81
(D) 3.33


Answer: (A)

Explanation: For 11 items, Binary search required total number of comparisons for each item as following:

333

Therefore, total number of caparisons required
= 1*1 + 2*2 + 4*3 + 4*4 = 33

Average comparisons required for 11 items = 33/11 = 3

So, option (A) is correct.

Quiz of this Question

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :