mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-28 19:07:14 +00:00
build
This commit is contained in:
@@ -486,7 +486,7 @@ comments: true
|
||||
|
||||
### 2. 转化为查找元素
|
||||
|
||||
我们知道,当数组不包含 `target` 时,最终 $i$ 和 $j$ 会分别指向首个大于、小于 `target` 的元素。
|
||||
我们知道,当数组不包含 `target` 时,最终 $i$ 和 $j$ 会分别指向首个大于 `target` 的元素和最右一个小于 `target` 的元素。
|
||||
|
||||
因此,如图 10-8 所示,我们可以构造一个数组中不存在的元素,用于查找左右边界。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user