Searching Algorithms: Binary Search - Implementations in C++ - Applications

Download Q&A
Q. In a binary search algorithm, if the target is less than the mid element, 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 will be the result of a binary search if the target element is not present in the array?
  • A. Returns the index of the closest element
  • B. Returns -1
  • C. Returns the index of the last element
  • D. Returns the index of the first element
Q. Which of the following scenarios is NOT suitable for binary search?
  • A. Searching in a sorted array
  • B. Searching in a linked list
  • C. Searching in a sorted list
  • D. Searching in a sorted tree
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