mirror of
https://github.com/krahets/hello-algo.git
synced 2026-05-03 07:10:41 +08:00
build
This commit is contained in:
@@ -10,7 +10,7 @@ comments: true
|
||||
|
||||
给定一个长度为 $n$ 的数组 `nums` ,元素按从小到大的顺序排列,数组不包含重复元素。请查找并返回元素 `target` 在该数组中的索引。若数组不包含该元素,则返回 $-1$ 。
|
||||
|
||||

|
||||
{ class="animation-figure" }
|
||||
|
||||
<p align="center"> 图 10-1 二分查找示例数据 </p>
|
||||
|
||||
@@ -27,25 +27,25 @@ comments: true
|
||||
若数组不包含目标元素,搜索区间最终会缩小为空。此时返回 $-1$ 。
|
||||
|
||||
=== "<1>"
|
||||

|
||||
{ class="animation-figure" }
|
||||
|
||||
=== "<2>"
|
||||

|
||||
{ class="animation-figure" }
|
||||
|
||||
=== "<3>"
|
||||

|
||||
{ class="animation-figure" }
|
||||
|
||||
=== "<4>"
|
||||

|
||||
{ class="animation-figure" }
|
||||
|
||||
=== "<5>"
|
||||

|
||||
{ class="animation-figure" }
|
||||
|
||||
=== "<6>"
|
||||

|
||||
{ class="animation-figure" }
|
||||
|
||||
=== "<7>"
|
||||

|
||||
{ class="animation-figure" }
|
||||
|
||||
<p align="center"> 图 10-2 二分查找流程 </p>
|
||||
|
||||
@@ -627,7 +627,7 @@ comments: true
|
||||
|
||||
由于“双闭区间”表示中的左右边界都被定义为闭区间,因此指针 $i$ 和 $j$ 缩小区间操作也是对称的。这样更不容易出错,**因此一般建议采用“双闭区间”的写法**。
|
||||
|
||||

|
||||
{ class="animation-figure" }
|
||||
|
||||
<p align="center"> 图 10-3 两种区间定义 </p>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user