3,760 views
3 votes
3 votes
Suppose we have the following sorted list:
[3, 5, 6, 8, 11, 12, 14, 15, 17, 18]
and array data structure is used. We are using recursive binary search algorithm to search an element 8. Which of the following group of number correctly shown the sequence of comparison used to find element 8?
(Assume array index starting with 0).

a) 11,5,6,8

b) 12,6,11,8

2 Answers

Answer:

Related questions

0 votes
0 votes
2 answers
1
dhruba asked Jun 5, 2023
1,091 views
Binary search is performed on a sorted array of n elements. The search key is not in the array and falls between the elements at positions m and m+1 (where 1 ≤ m < n). ...
1 votes
1 votes
4 answers
2
Abhishek Kumar 38 asked Dec 15, 2018
2,056 views
There are two sorted list each of length n. An element to be searched in the both the lists. The lists are mutually exclusive. The maximum number of comparisons required ...
2 votes
2 votes
4 answers
3
aditi19 asked Aug 20, 2018
2,568 views
for binary search in an array of n elements the average number of searches is $\left \lfloor \log_{2}n \right \rfloor$ or $\left \lceil \log_{2}n \right \rceil$ ?
0 votes
0 votes
1 answer
4
Sabir Khan asked Aug 8, 2018
1,056 views
The minimum number of comparisons required to determine if an integer appears more than n/2 times in a sorted array of n integers is(A) (n)(B) (logn)(C) (log*n)(D) (1)