in Algorithms
198 views
0 votes
0 votes

how O(logn) ? 

if no such a[i] exist in array then in worst case we have to apply binary search for every element and it will take O(nlogn) so better we can have linear search that would take O(n) as we have to travrset it only once .

 

in Algorithms
198 views

Please log in or register to answer this question.