Searching Algorithms: Binary Search - Implementations in Python - Advanced Concepts

Download Q&A
Q. In a recursive implementation of binary search, what is the base case?
  • A. When the array is empty
  • B. When the target is found
  • C. When the left index exceeds the right index
  • D. When the mid index is zero
Q. What is the result of the following binary search on the array [1, 2, 3, 4, 5] for target 3?
  • A. 0
  • B. 1
  • C. 2
  • D. 3
Q. Which of the following scenarios would NOT be 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