mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-15 21:20:58 +00:00
deploy
This commit is contained in:
@@ -1889,7 +1889,7 @@
|
||||
|
||||
|
||||
<h1 id="102">10.2. 二分查找边界<a class="headerlink" href="#102" title="Permanent link">¶</a></h1>
|
||||
<p>上一节规定目标元素在数组中是唯一的。如果目标元素在数组中多次出现,上节介绍的方法只能保证返回其中一个目标元素的索引,<strong>而无法确定该索引的左边和右边还有多少目标元素</strong>。</p>
|
||||
<p>在上一节中,题目规定数组中所有元素都是唯一的。如果目标元素在数组中多次出现,上节介绍的方法只能保证返回其中一个目标元素的索引,<strong>而无法确定该索引的左边和右边还有多少目标元素</strong>。</p>
|
||||
<div class="admonition question">
|
||||
<p class="admonition-title">Question</p>
|
||||
<p>给定一个长度为 <span class="arithmatex">\(n\)</span> 的有序数组 <code>nums</code> ,数组可能包含重复元素。请查找并返回元素 <code>target</code> 在数组中首次出现的索引。若数组中不包含该元素,则返回 <span class="arithmatex">\(-1\)</span> 。</p>
|
||||
|
||||
Reference in New Issue
Block a user