Searching Algorithms: Binary Search - Complexity Analysis

Download Q&A
Q. If an array has 16 elements, how many comparisons will binary search make in the worst case?
  • A. 4
  • B. 5
  • C. 16
  • D. 8
Q. If the size of the array is doubled, how does the time complexity of binary search change?
  • A. It doubles
  • B. It remains the same
  • C. It becomes O(n)
  • D. It becomes O(n log n)
Q. In binary search, what happens if the middle element is greater than the target?
  • A. Search the left half
  • B. Search the right half
  • C. Search both halves
  • D. Return the middle element
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