doc: update binary search file

This commit is contained in:
Leon Xu committed 2021-07-07 10:43:06 -07:00
1 parent b6b271c668
commit f18502f5a8
1 file changed
+5 -3
+5 -3
View File
@@ -1,11 +1,13 @@
---
title: Binary Search(二分查找算法)
title: Binary Search(二分搜索)
date: 2021-07-07 10:31:20
tags: 算法
---
## 什么是二分查找算法?
- 二分查找算法是一种算法;它的输入是一个已排序的元素列表。如果你要找的元素在这个列表中,二分查找返回它所在的位置。否则,二进制搜索返回**null**。
- 二分搜索是一种算法;它的输入是一个已排序的元素列表。如果你要找的元素在这个列表中,二分查找返回它所在的位置。否则,二进制搜索返回**null**。
一些二分搜索的坏例子:
- 下面是一些二分搜索的例子:
- 假设你在玩一个数字猜谜游戏,我会告诉你你的数字是高、低还是正确。
- 假设你在玩一个数字猜谜游戏,我会告诉你你的数字是高、低还是正确。
![BinarySearch1](images/Algorithms/BinarySearch1.png)