file & doc: Binary-search

This commit is contained in:
Leon Xu committed 2021-07-07 10:32:53 -07:00
1 parent 181e1e2a78
commit 16e5d8e4ae
1 file changed
+11
+11
View File
@@ -0,0 +1,11 @@
---
title: Binary Search(二分算法)
date: 2021-07-07 10:31:20
tags: 算法
---
## 什么是二分算法?
- 二分搜索是一种算法;它的输入是一个已排序的元素列表。如果一个元素查找在列表中,二分查找返回它所在的位置。否则,二进制搜索返回**null**。
- 下面是一些二分搜索的例子:
- 假设你在玩一个数字猜谜游戏,我会告诉你你的数字是高、低还是正确。