What is the result of a binary search if the array is empty?

Practice Questions

1 question
Q1
What is the result of a binary search if the array is empty?
  1. Returns 0
  2. Returns -1
  3. Returns null
  4. Returns an error

Questions & Step-by-step Solutions

1 item
Q
Q: What is the result of a binary search if the array is empty?
Solution: If the array is empty, binary search will return -1, indicating that the target is not found.
Steps: 4

Related Questions

Soulshift Feedback ×

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

Not likely Very likely