Wikipedia article of the day for October 29, 2018 - Hindi english news

Hindi english news

You get hindi and english news everyday with best content

Breaking

Home Top Ad

Post Top Ad

Responsive Ads Here

Monday, October 29, 2018

Wikipedia article of the day for October 29, 2018

The Wikipedia article of the day for October 29, 2018 is Binary search algorithm.
A binary search algorithm is a method to determine the position of a target value within a sorted array (an ordered list). Binary search compares the target value to the middle element of the array. If they are not equal, the half in which the target cannot lie is eliminated and the search continues on the remaining half, again taking the middle element to compare to the target value, and so on. If the remaining half at any stage is found to be empty, then the target is not in the array. Even though the idea is simple, implementing binary search correctly requires attention to some subtleties about its exit conditions and midpoint calculation. Binary search runs in logarithmic time in the worst case. It is faster than linear search except for small arrays, but the array must be sorted first. Although specialized data structures designed for fast searching, such as hash tables, can be searched more efficiently, binary search applies to a wider range of problems.

No comments:

Post a Comment

Finnish Lawmaker Who Fired Gun Outside Bar Is Expelled From Party

By Johanna Lemola and Emma Bubola from NYT World https://ift.tt/qQftvAN

Post Bottom Ad

Responsive Ads Here

Pages