mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-21 02:56:11 +00:00
deploy
This commit is contained in:
@@ -3436,9 +3436,9 @@
|
||||
<li>递归求解规模减小一半的子问题,可能为 <span class="arithmatex">\(f(i, m-1)\)</span> 或 <span class="arithmatex">\(f(m+1, j)\)</span> 。</li>
|
||||
<li>循环第 <code>1.</code> , <code>2.</code> 步,直至找到 <code>target</code> 或区间为空时返回。</li>
|
||||
</ol>
|
||||
<p>下图展示了在数组中二分查找元素 <span class="arithmatex">\(6\)</span> 的分治过程。</p>
|
||||
<p>图 12-4 展示了在数组中二分查找元素 <span class="arithmatex">\(6\)</span> 的分治过程。</p>
|
||||
<p><img alt="二分查找的分治过程" src="../binary_search_recur.assets/binary_search_recur.png" /></p>
|
||||
<p align="center"> 图:二分查找的分治过程 </p>
|
||||
<p align="center"> 图 12-4 二分查找的分治过程 </p>
|
||||
|
||||
<p>在实现代码中,我们声明一个递归函数 <code>dfs()</code> 来求解问题 <span class="arithmatex">\(f(i, j)\)</span> 。</p>
|
||||
<div class="tabbed-set tabbed-alternate" data-tabs="1:12"><input checked="checked" id="__tabbed_1_1" name="__tabbed_1" type="radio" /><input id="__tabbed_1_2" name="__tabbed_1" type="radio" /><input id="__tabbed_1_3" name="__tabbed_1" type="radio" /><input id="__tabbed_1_4" name="__tabbed_1" type="radio" /><input id="__tabbed_1_5" name="__tabbed_1" type="radio" /><input id="__tabbed_1_6" name="__tabbed_1" type="radio" /><input id="__tabbed_1_7" name="__tabbed_1" type="radio" /><input id="__tabbed_1_8" name="__tabbed_1" type="radio" /><input id="__tabbed_1_9" name="__tabbed_1" type="radio" /><input id="__tabbed_1_10" name="__tabbed_1" type="radio" /><input id="__tabbed_1_11" name="__tabbed_1" type="radio" /><input id="__tabbed_1_12" name="__tabbed_1" type="radio" /><div class="tabbed-labels"><label for="__tabbed_1_1">Java</label><label for="__tabbed_1_2">C++</label><label for="__tabbed_1_3">Python</label><label for="__tabbed_1_4">Go</label><label for="__tabbed_1_5">JS</label><label for="__tabbed_1_6">TS</label><label for="__tabbed_1_7">C</label><label for="__tabbed_1_8">C#</label><label for="__tabbed_1_9">Swift</label><label for="__tabbed_1_10">Zig</label><label for="__tabbed_1_11">Dart</label><label for="__tabbed_1_12">Rust</label></div>
|
||||
|
||||
Reference in New Issue
Block a user