mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-29 03:17:13 +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