python中的二进制搜索算法解释

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位

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值