Searching Algorithms: Binary Search - Implementations in C++ - Problem Set

Download Q&A
Q. In a binary search implementation, if the target is less than the mid value, what should be the next step?
  • A. Search the right half
  • B. Search the left half
  • C. Return the mid index
  • D. Increase the mid index
Q. What is the space complexity of the binary search algorithm?
  • A. O(n)
  • B. O(log n)
  • C. O(1)
  • D. O(n log n)
Q. What will be the result of a binary search if the target value is not present in the array?
  • A. The index of the closest value
  • B. The index of the target value
  • C. A negative value or -1
  • D. An error message
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