3,975 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

1.3k
views
2 answers
0 votes
dhruba asked Jun 5, 2023
1,290 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). How ... . ceil(log(n))b. floor(log(n))c. ceil(log(m))d. floor(log(m))
2.2k
views
4 answers
1 votes
Abhishek Kumar 38 asked Dec 15, 2018
2,215 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 using binary search and find its time complexity?
2.9k
views
4 answers
2 votes
aditi19 asked Aug 20, 2018
2,866 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$ ?
1.1k
views
1 answers
0 votes
Sabir Khan asked Aug 8, 2018
1,143 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)