Computer Science, asked by sabihabashar, 1 year ago

What is the limitation of binary search?

Answers

Answered by Anonymous
10

The elements need to be sorted because a binary search assumes that the middle value is the median of all of the values. In the worst case scenario, the element you are searching for will not exist and will either be larger than the greatest value that exists or smaller than the smallest value that exists.

Answered by subhashnidevi4878
1

A binary search function is built into the c libraries

Explanation:

The major limitation of binary search is that there is a need for the sorted array to perform the binary search operation.

If the array is not sorted the output is either not correct or maybe after a long number of steps and according to the data structure, the output should come in a minimum number of steps.

A binary search is typically faster than a sequential search but requires that the data is sorted. Binary search has logarithmic time complexity whereas, Sequential search has linear time complexity.

Similar questions