0 votes
in Data Structures & Algorithms II by (110k points)
Given an array arr = {5,6,77,88,99} and key = 88; How many iterations are done until the element is found?

(a) 1

(b) 3

(c) 4

(d) 2

I had been asked this question during an interview.

My question is taken from Binary Search Iterative in section Searching of Data Structures & Algorithms II

1 Answer

+1 vote
by (614k points)
selected by
Best answer
Right option is (d) 2

For explanation: Iteration1 : mid = 77; Iteration2 : mid = 88;

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.