Binary search also known as half-interval search, logarithmic search is an algorithm used in computers to find the position of a value in a sorted array.
二进制搜索也称为半间隔搜索 , 对数搜索是计算机中用于查找排序数组中值位置的算法。
Bubble sort, Linear search, Quick sort are some of the other type of sorting algorithm available. In this article we are going to learn about the searching algorithm known as Binary search.
冒泡排序 , 线性搜索 ,快速排序是可用的其他一些排序算法。 在本文中,我们将学习称为二进制搜索的搜索算法。
Binary search is little bit more advanced and have more accurate results when compared with linear search and bubble sort algorithms.
与线性搜索和气泡排序算法相比,二进制搜索稍微先进一些,并且结果更准确。
So let’s assume that you have a list with 10000 items in it. The item you are looking for is in the 9000th place. If you implement the linear search algorithm in this scenario it will take much time to give you the result. Because the algorithm needs check each and every item in the list.
因此,假设您有一个包含10000个项目的列表。 您正在寻找的项目在第9000位