Searching Algorithms: Binary Search - Implementations in Python - Competitive Exam Level

Download Q&A
Q. If the array is [1, 2, 3, 4, 5] and the target is 3, what will be the mid index during the first iteration?
  • A. 0
  • B. 1
  • C. 2
  • D. 3
Q. What will be the output of the binary search function if the target is not found?
  • A. The index of the closest element
  • B. The index of the target
  • C. -1
  • D. 0
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