Computer Science, asked by kumaryuvraj819, 1 month ago

Explain the advantages of
binary search over sequential/linear search.

Answers

Answered by NavyaRanjan
0

In linear serach when you perform one operation you reduce the size of the problem by one . But when you do one operation in binary search you reduce the size of the problem by half . It sounds efficient , isn't it

That's why time complexity of linear/sequential search is O(n) while binary search is O(logn).

Note - binary serach is applied only on sorted arrays.

I answered this question assuming that you have already read theory and algorithm of Binary as well as sequential serach .

Similar questions