This commit is contained in:
krahets
2023-08-28 23:52:41 +08:00
parent 2f0f154b3c
commit 88a746f493
7 changed files with 21 additions and 21 deletions
+2 -2
View File
@@ -115,9 +115,9 @@
[class]{}-[func]{binary_search}
```
时间复杂度 $O(\log n)$ 。每轮缩小一半区间,因此二分循环次数为 $\log_2 n$ 。
**时间复杂度 $O(\log n)$** :在二分循环中,区间每轮缩小一半,循环次数为 $\log_2 n$ 。
空间复杂度 $O(1)$指针 $i$ 和 $j$ 使用常数大小空间。
**空间复杂度 $O(1)$** 指针 $i$ 和 $j$ 使用常数大小空间。
## 区间表示方法