search
Log In
8 votes
4.9k views

The time taken by binary search algorithm to search a key in a sorted array of $n$ elements is

  1. $O\: (\log_2 \: n)$
  2. $O \:  (n)$
  3. $O \: (n \: \log_2 \: n)$
  4. $O \:  (n^2)$
in Algorithms
edited by
4.9k views

3 Answers

5 votes
 
Best answer
A     O(logn)

selected by
3 votes
Binary search is always for sorted array , and it takes A) O(log n) time for searching an element
1 vote
Binary Search Algorithm takes O(log n) time in order to search an element in the array of sorted list...
Answer:

Related questions

11 votes
3 answers
1
3.2k views
Djikstra’s algorithm is used to Create LSAs Flood an internet with information Calculate the routing tables Create a link state database
asked Jun 10, 2016 in Algorithms jothee 3.2k views
5 votes
2 answers
2
2k views
A rule in a limited entry decision table is a row of the table consisting of condition entries row of the table consisting of action entries column of the table consisting of condition entries and the corresponding action entries columns of the table consisting of conditions of the stub
asked Jun 10, 2016 in Algorithms jothee 2k views
7 votes
2 answers
3
1.4k views
The average case and worst case complexities for Merge sort algorithm are $O \: (n^2), O\: (n^2)$ $O \: (n^2), O\: (n \log_2 n)$ $ O\: (n \log_2 n), O \: (n^2)$ $ O\: (n \log_2 n), O\: (n \log_2 n)$
asked Jun 10, 2016 in Algorithms jothee 1.4k views
6 votes
3 answers
4
3.2k views
Selection sort algorithm design technique is an example of Greedy method Divide-and-conquer Dynamic Programming Backtracking
asked Jun 10, 2016 in Algorithms jothee 3.2k views
...