Searching Algorithms: Binary Search - Implementations in C++ - Case Studies

Download Q&A
Q. In a binary search, 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 iterative binary search algorithm?
  • A. O(n)
  • B. O(log n)
  • C. O(1)
  • D. O(n log n)
Q. Which of the following best describes the iterative approach to binary search?
  • A. Uses recursion
  • B. Uses a loop to narrow down the search
  • C. Requires additional data structures
  • D. Always returns the first occurrence
Q. Which of the following statements is true about binary search?
  • A. It can be used on unsorted arrays
  • B. It requires a sorted array
  • C. It is slower than linear search
  • D. It can only find unique elements
Showing 1 to 4 of 4 (1 Pages)
Soulshift Feedback ×

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

Not likely Very likely