The program written for binary search, calculates the midpoint of the span as mid : = (Low + High)/2. The program works well if the number of elements in the list is small (about 32,000) but it behaves abnormally when the number of elements is large. This can be avoided by performing the calculation as:

1
mid : = (High - Low)/2 + Low
2
mid : = (High - Low + 1)/2
3
mid : = (High - Low)/2
4
mid : = (High + Low)/2
5
Question Not Attempted

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation