+1 vote
in Data Structures & Algorithms II by (110k points)
Given an array arr = {45,77,89,90,94,99,100} and key = 100; What are the mid values(corresponding array elements) generated in the first and second iterations?

(a) 90 and 99

(b) 90 and 100

(c) 89 and 94

(d) 94 and 99

The question was posed to me in an online interview.

The above asked question is from Binary Search Iterative topic in portion Searching of Data Structures & Algorithms II

1 Answer

+1 vote
by (614k points)
selected by
Best answer
Correct answer is (a) 90 and 99

Explanation: Trace the input with the binary search iterative code.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.