Question

Perform a dry run of Binary Search for target = 29 in the sorted array [2, 12, 15, 17, 27, 29, 45]. What are the values of mid in each iteration until the target is found?

A 17, 29 Correct Answer Incorrect Answer
B 17, 45, 29 Correct Answer Incorrect Answer
C 17, 27, 29 Correct Answer Incorrect Answer
D 17, 29, 45 Correct Answer Incorrect Answer
E 15, 27, 29 Correct Answer Incorrect Answer

Solution

The correct answer is A

Practice Next
ask-question