Searching Algorithms: Binary Search - Competitive Exam Level

Download Q&A
Q. If a sorted array has 16 elements, how many comparisons will binary search make in the worst case?
  • A. 4
  • B. 5
  • C. 16
  • D. 8
Q. If the target value is not present in a sorted array, what will binary search return?
  • A. The index of the closest value
  • B. The index of the first element
  • C. The index of the last element
  • D. -1 or a sentinel value
Showing 1 to 2 of 2 (1 Pages)
Soulshift Feedback ×

On a scale of 0–10, how likely are you to recommend The Soulshift Academy?

Not likely Very likely