Given an array X = (22, 33, 55, 88, 96) and key = 88. How many iterations are…

2023

Given an array X = (22, 33, 55, 88, 96) and key = 88. How many iterations are required to find the key using binary search?

  1. A.

    3

  2. B.

    2

  3. C.

    1

  4. D.

    4

Attempted by 106 students.

Show answer & explanation

Correct answer: B

Binary search first checks the middle value 55, then searches the right half and checks 88. The key is found in 2 iterations.

Explore the full course: Coal India Management Trainee