Searching Algorithms: Binary Search - Typical Problems - Advanced Concepts

Download Q&A
Q. In a binary search, if the middle element is greater than the target, which half of the array is searched next?
  • A. Left half
  • B. Right half
  • C. Both halves
  • D. None
Q. In binary search, what is the formula to find the middle index?
  • A. (low + high) / 2
  • B. (low + high) / 2 + 1
  • C. (low + high) / 2 - 1
  • D. low + high
Q. What is the result of a binary search if the array is empty?
  • A. Returns 0
  • B. Returns -1
  • C. Returns null
  • D. Returns an error
Showing 1 to 3 of 3 (1 Pages)
Soulshift Feedback ×

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

Not likely Very likely