in Algorithms retagged by
10,597 views
10 votes
10 votes

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 retagged by
10.6k views

3 Answers

7 votes
7 votes
Best answer
A     O(logn)
selected by
5 votes
5 votes
Binary search is always for sorted array , and it takes A) O(log n) time for searching an element
2 votes
2 votes
Binary Search Algorithm takes O(log n) time in order to search an element in the array of sorted list...
Answer:

Related questions