This commit is contained in:
krahets
2024-01-07 23:43:01 +08:00
parent 547093210e
commit ca63e0e7f7
55 changed files with 651 additions and 290 deletions
+109 -108
View File
@@ -431,45 +431,45 @@
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#021-conventions-of-style" class="md-nav__link">
<a href="#021-writing-conventions" class="md-nav__link">
<span class="md-ellipsis">
0.2.1 &nbsp; Conventions Of Style
0.2.1 &nbsp; Writing Conventions
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#022-learn-efficiently-in-animated-graphic-solutions" class="md-nav__link">
<a href="#022-efficient-learning-via-animated-illustrations" class="md-nav__link">
<span class="md-ellipsis">
0.2.2 &nbsp; Learn Efficiently In Animated Graphic Solutions
0.2.2 &nbsp; Efficient Learning via Animated Illustrations
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#023-deeper-understanding-in-code-practice" class="md-nav__link">
<a href="#023-deepen-understanding-through-coding-practice" class="md-nav__link">
<span class="md-ellipsis">
0.2.3 &nbsp; Deeper Understanding In Code Practice
0.2.3 &nbsp; Deepen Understanding through Coding Practice
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#024-growing-together-in-questioning-and-discussion" class="md-nav__link">
<a href="#024-learning-together-in-discussion" class="md-nav__link">
<span class="md-ellipsis">
0.2.4 &nbsp; Growing Together In Questioning And Discussion
0.2.4 &nbsp; Learning Together in Discussion
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#025-algorithm-learning-route" class="md-nav__link">
<a href="#025-algorithm-learning-path" class="md-nav__link">
<span class="md-ellipsis">
0.2.5 &nbsp; Algorithm Learning Route
0.2.5 &nbsp; Algorithm Learning Path
</span>
</a>
@@ -1201,45 +1201,45 @@
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#021-conventions-of-style" class="md-nav__link">
<a href="#021-writing-conventions" class="md-nav__link">
<span class="md-ellipsis">
0.2.1 &nbsp; Conventions Of Style
0.2.1 &nbsp; Writing Conventions
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#022-learn-efficiently-in-animated-graphic-solutions" class="md-nav__link">
<a href="#022-efficient-learning-via-animated-illustrations" class="md-nav__link">
<span class="md-ellipsis">
0.2.2 &nbsp; Learn Efficiently In Animated Graphic Solutions
0.2.2 &nbsp; Efficient Learning via Animated Illustrations
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#023-deeper-understanding-in-code-practice" class="md-nav__link">
<a href="#023-deepen-understanding-through-coding-practice" class="md-nav__link">
<span class="md-ellipsis">
0.2.3 &nbsp; Deeper Understanding In Code Practice
0.2.3 &nbsp; Deepen Understanding through Coding Practice
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#024-growing-together-in-questioning-and-discussion" class="md-nav__link">
<a href="#024-learning-together-in-discussion" class="md-nav__link">
<span class="md-ellipsis">
0.2.4 &nbsp; Growing Together In Questioning And Discussion
0.2.4 &nbsp; Learning Together in Discussion
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#025-algorithm-learning-route" class="md-nav__link">
<a href="#025-algorithm-learning-path" class="md-nav__link">
<span class="md-ellipsis">
0.2.5 &nbsp; Algorithm Learning Route
0.2.5 &nbsp; Algorithm Learning Path
</span>
</a>
@@ -1286,191 +1286,192 @@
<p class="admonition-title">Tip</p>
<p>For the best reading experience, it is recommended that you read through this section.</p>
</div>
<h2 id="021-conventions-of-style">0.2.1 &nbsp; Conventions Of Style<a class="headerlink" href="#021-conventions-of-style" title="Permanent link">&para;</a></h2>
<h2 id="021-writing-conventions">0.2.1 &nbsp; Writing Conventions<a class="headerlink" href="#021-writing-conventions" title="Permanent link">&para;</a></h2>
<ul>
<li>Those labeled <code>*</code> after the title are optional chapters with relatively difficult content. If you have limited time, it is advisable to skip them.</li>
<li>Proper nouns and words and phrases with specific meanings are marked with <code>"double quotes"</code> to avoid ambiguity.</li>
<li>Important proper nouns and their English translations are marked with <code>" "</code> in parentheses, e.g. <code>"array array"</code> . It is recommended to memorize them for reading the literature.</li>
<li><strong>Bolded text</strong> Indicates key content or summary statements, which deserve special attention.</li>
<li>When it comes to terms that are inconsistent between programming languages, this book follows Python, for example using <code>None</code> to mean "empty".</li>
<li>This book partially abandons the specification of annotations in programming languages in exchange for a more compact layout of the content. There are three main types of annotations: title annotations, content annotations, and multi-line annotations.</li>
<li>Chapters marked with '*' after the title are optional and contain relatively challenging content. If you are short on time, it is advisable to skip them.</li>
<li>Key technical terms and their English equivalents are enclosed in <strong>Bold</strong> + <em>italics</em> brackets, for example, <strong><em>array</em></strong>. It's advisable to familiarize yourself with these for better comprehension of technical texts.</li>
<li>Proprietary terms and words with specific meanings are indicated with “quotation marks” to avoid ambiguity.</li>
<li><strong>Bolded text</strong> indicates key content or summary statements, which deserve special attention.</li>
<li>When it comes to terms that are inconsistent between programming languages, this book follows Python, for example using <span class="arithmatex">\(\text{None}\)</span> to mean "null".</li>
<li>This book partially ignores the comment conventions for programming languages in exchange for a more compact layout of the content. The comments primarily consist of three types: title comments, content comments, and multi-line comments.</li>
</ul>
<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">Python</label><label for="__tabbed_1_2">C++</label><label for="__tabbed_1_3">Java</label><label for="__tabbed_1_4">C#</label><label for="__tabbed_1_5">Go</label><label for="__tabbed_1_6">Swift</label><label for="__tabbed_1_7">JS</label><label for="__tabbed_1_8">TS</label><label for="__tabbed_1_9">Dart</label><label for="__tabbed_1_10">Rust</label><label for="__tabbed_1_11">C</label><label for="__tabbed_1_12">Zig</label></div>
<div class="tabbed-content">
<div class="tabbed-block">
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="sd">&quot;&quot;&quot;Header comments for labeling functions, classes, test samples, etc.&quot;&quot;&quot;</span><span class="s2">&quot;</span>
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="sd">&quot;&quot;&quot;Header comments for labeling functions, classes, test samples, etc&quot;&quot;&quot;</span><span class="s2">&quot;</span>
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a>
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="c1"># Content comments for detailed code solutions</span>
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="c1"># Comments for explaining details</span>
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a>
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#__codelineno-0-5"></a><span class="sd">&quot;&quot;&quot;</span>
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#__codelineno-0-6"></a><span class="sd">multi-line</span>
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#__codelineno-0-7"></a><span class="sd">marginal notes</span>
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#__codelineno-0-6"></a><span class="sd">Multiline</span>
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#__codelineno-0-7"></a><span class="sd">comments</span>
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#__codelineno-0-8"></a><span class="sd">&quot;&quot;&quot;</span>
</code></pre></div>
</div>
<div class="tabbed-block">
<div class="highlight"><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a><span class="cm">/* Header comments for labeling functions, classes, test samples, etc. */</span>
<div class="highlight"><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a><span class="cm">/* Header comments for labeling functions, classes, test samples, etc */</span>
<a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a>
<a id="__codelineno-1-3" name="__codelineno-1-3" href="#__codelineno-1-3"></a><span class="c1">// Content comments for detailed code solutions.</span>
<a id="__codelineno-1-3" name="__codelineno-1-3" href="#__codelineno-1-3"></a><span class="c1">// Comments for explaining details.</span>
<a id="__codelineno-1-4" name="__codelineno-1-4" href="#__codelineno-1-4"></a>
<a id="__codelineno-1-5" name="__codelineno-1-5" href="#__codelineno-1-5"></a><span class="cm">/**</span>
<a id="__codelineno-1-6" name="__codelineno-1-6" href="#__codelineno-1-6"></a><span class="cm"> * multi-line</span>
<a id="__codelineno-1-7" name="__codelineno-1-7" href="#__codelineno-1-7"></a><span class="cm"> * marginal notes</span>
<a id="__codelineno-1-6" name="__codelineno-1-6" href="#__codelineno-1-6"></a><span class="cm"> * Multiline</span>
<a id="__codelineno-1-7" name="__codelineno-1-7" href="#__codelineno-1-7"></a><span class="cm"> * comments</span>
<a id="__codelineno-1-8" name="__codelineno-1-8" href="#__codelineno-1-8"></a><span class="cm"> */</span>
</code></pre></div>
</div>
<div class="tabbed-block">
<div class="highlight"><pre><span></span><code><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a><span class="cm">/* Header comments for labeling functions, classes, test samples, etc. */</span>
<div class="highlight"><pre><span></span><code><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a><span class="cm">/* Header comments for labeling functions, classes, test samples, etc */</span>
<a id="__codelineno-2-2" name="__codelineno-2-2" href="#__codelineno-2-2"></a>
<a id="__codelineno-2-3" name="__codelineno-2-3" href="#__codelineno-2-3"></a><span class="c1">// Content comments for detailed code solutions.</span>
<a id="__codelineno-2-3" name="__codelineno-2-3" href="#__codelineno-2-3"></a><span class="c1">// Comments for explaining details.</span>
<a id="__codelineno-2-4" name="__codelineno-2-4" href="#__codelineno-2-4"></a>
<a id="__codelineno-2-5" name="__codelineno-2-5" href="#__codelineno-2-5"></a><span class="cm">/**</span>
<a id="__codelineno-2-6" name="__codelineno-2-6" href="#__codelineno-2-6"></a><span class="cm"> * multi-line</span>
<a id="__codelineno-2-7" name="__codelineno-2-7" href="#__codelineno-2-7"></a><span class="cm"> * marginal notes</span>
<a id="__codelineno-2-6" name="__codelineno-2-6" href="#__codelineno-2-6"></a><span class="cm"> * Multiline</span>
<a id="__codelineno-2-7" name="__codelineno-2-7" href="#__codelineno-2-7"></a><span class="cm"> * comments</span>
<a id="__codelineno-2-8" name="__codelineno-2-8" href="#__codelineno-2-8"></a><span class="cm"> */</span>
</code></pre></div>
</div>
<div class="tabbed-block">
<div class="highlight"><pre><span></span><code><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a><span class="cm">/* Header comments for labeling functions, classes, test samples, etc. */</span>
<div class="highlight"><pre><span></span><code><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a><span class="cm">/* Header comments for labeling functions, classes, test samples, etc */</span>
<a id="__codelineno-3-2" name="__codelineno-3-2" href="#__codelineno-3-2"></a>
<a id="__codelineno-3-3" name="__codelineno-3-3" href="#__codelineno-3-3"></a><span class="c1">// Content comments for detailed code solutions.</span>
<a id="__codelineno-3-3" name="__codelineno-3-3" href="#__codelineno-3-3"></a><span class="c1">// Comments for explaining details.</span>
<a id="__codelineno-3-4" name="__codelineno-3-4" href="#__codelineno-3-4"></a>
<a id="__codelineno-3-5" name="__codelineno-3-5" href="#__codelineno-3-5"></a><span class="cm">/**</span>
<a id="__codelineno-3-6" name="__codelineno-3-6" href="#__codelineno-3-6"></a><span class="cm"> * multi-line</span>
<a id="__codelineno-3-7" name="__codelineno-3-7" href="#__codelineno-3-7"></a><span class="cm"> * marginal notes</span>
<a id="__codelineno-3-6" name="__codelineno-3-6" href="#__codelineno-3-6"></a><span class="cm"> * Multiline</span>
<a id="__codelineno-3-7" name="__codelineno-3-7" href="#__codelineno-3-7"></a><span class="cm"> * comments</span>
<a id="__codelineno-3-8" name="__codelineno-3-8" href="#__codelineno-3-8"></a><span class="cm"> */</span>
</code></pre></div>
</div>
<div class="tabbed-block">
<div class="highlight"><pre><span></span><code><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a><span class="cm">/* Header comments for labeling functions, classes, test samples, etc. */</span>
<div class="highlight"><pre><span></span><code><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a><span class="cm">/* Header comments for labeling functions, classes, test samples, etc */</span>
<a id="__codelineno-4-2" name="__codelineno-4-2" href="#__codelineno-4-2"></a>
<a id="__codelineno-4-3" name="__codelineno-4-3" href="#__codelineno-4-3"></a><span class="c1">// Content comments for detailed code solutions.</span>
<a id="__codelineno-4-3" name="__codelineno-4-3" href="#__codelineno-4-3"></a><span class="c1">// Comments for explaining details.</span>
<a id="__codelineno-4-4" name="__codelineno-4-4" href="#__codelineno-4-4"></a>
<a id="__codelineno-4-5" name="__codelineno-4-5" href="#__codelineno-4-5"></a><span class="cm">/**</span>
<a id="__codelineno-4-6" name="__codelineno-4-6" href="#__codelineno-4-6"></a><span class="cm"> * multi-line</span>
<a id="__codelineno-4-7" name="__codelineno-4-7" href="#__codelineno-4-7"></a><span class="cm"> * marginal notes</span>
<a id="__codelineno-4-6" name="__codelineno-4-6" href="#__codelineno-4-6"></a><span class="cm"> * Multiline</span>
<a id="__codelineno-4-7" name="__codelineno-4-7" href="#__codelineno-4-7"></a><span class="cm"> * comments</span>
<a id="__codelineno-4-8" name="__codelineno-4-8" href="#__codelineno-4-8"></a><span class="cm"> */</span>
</code></pre></div>
</div>
<div class="tabbed-block">
<div class="highlight"><pre><span></span><code><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a><span class="cm">/* Header comments for labeling functions, classes, test samples, etc. */</span>
<div class="highlight"><pre><span></span><code><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a><span class="cm">/* Header comments for labeling functions, classes, test samples, etc */</span>
<a id="__codelineno-5-2" name="__codelineno-5-2" href="#__codelineno-5-2"></a>
<a id="__codelineno-5-3" name="__codelineno-5-3" href="#__codelineno-5-3"></a><span class="c1">// Content comments for detailed code solutions.</span>
<a id="__codelineno-5-3" name="__codelineno-5-3" href="#__codelineno-5-3"></a><span class="c1">// Comments for explaining details.</span>
<a id="__codelineno-5-4" name="__codelineno-5-4" href="#__codelineno-5-4"></a>
<a id="__codelineno-5-5" name="__codelineno-5-5" href="#__codelineno-5-5"></a><span class="cm">/**</span>
<a id="__codelineno-5-6" name="__codelineno-5-6" href="#__codelineno-5-6"></a><span class="cm"> * multi-line</span>
<a id="__codelineno-5-7" name="__codelineno-5-7" href="#__codelineno-5-7"></a><span class="cm"> * marginal notes</span>
<a id="__codelineno-5-6" name="__codelineno-5-6" href="#__codelineno-5-6"></a><span class="cm"> * Multiline</span>
<a id="__codelineno-5-7" name="__codelineno-5-7" href="#__codelineno-5-7"></a><span class="cm"> * comments</span>
<a id="__codelineno-5-8" name="__codelineno-5-8" href="#__codelineno-5-8"></a><span class="cm"> */</span>
</code></pre></div>
</div>
<div class="tabbed-block">
<div class="highlight"><pre><span></span><code><a id="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a><span class="cm">/* Header comments for labeling functions, classes, test samples, etc. */</span>
<div class="highlight"><pre><span></span><code><a id="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a><span class="cm">/* Header comments for labeling functions, classes, test samples, etc */</span>
<a id="__codelineno-6-2" name="__codelineno-6-2" href="#__codelineno-6-2"></a>
<a id="__codelineno-6-3" name="__codelineno-6-3" href="#__codelineno-6-3"></a><span class="c1">// Content comments for detailed code solutions.</span>
<a id="__codelineno-6-3" name="__codelineno-6-3" href="#__codelineno-6-3"></a><span class="c1">// Comments for explaining details.</span>
<a id="__codelineno-6-4" name="__codelineno-6-4" href="#__codelineno-6-4"></a>
<a id="__codelineno-6-5" name="__codelineno-6-5" href="#__codelineno-6-5"></a><span class="cm">/**</span>
<a id="__codelineno-6-6" name="__codelineno-6-6" href="#__codelineno-6-6"></a><span class="cm"> * multi-line</span>
<a id="__codelineno-6-7" name="__codelineno-6-7" href="#__codelineno-6-7"></a><span class="cm"> * marginal notes</span>
<a id="__codelineno-6-6" name="__codelineno-6-6" href="#__codelineno-6-6"></a><span class="cm"> * Multiline</span>
<a id="__codelineno-6-7" name="__codelineno-6-7" href="#__codelineno-6-7"></a><span class="cm"> * comments</span>
<a id="__codelineno-6-8" name="__codelineno-6-8" href="#__codelineno-6-8"></a><span class="cm"> */</span>
</code></pre></div>
</div>
<div class="tabbed-block">
<div class="highlight"><pre><span></span><code><a id="__codelineno-7-1" name="__codelineno-7-1" href="#__codelineno-7-1"></a><span class="cm">/* Header comments for labeling functions, classes, test samples, etc. */</span>
<div class="highlight"><pre><span></span><code><a id="__codelineno-7-1" name="__codelineno-7-1" href="#__codelineno-7-1"></a><span class="cm">/* Header comments for labeling functions, classes, test samples, etc */</span>
<a id="__codelineno-7-2" name="__codelineno-7-2" href="#__codelineno-7-2"></a>
<a id="__codelineno-7-3" name="__codelineno-7-3" href="#__codelineno-7-3"></a><span class="c1">// Content comments for detailed code solutions.</span>
<a id="__codelineno-7-3" name="__codelineno-7-3" href="#__codelineno-7-3"></a><span class="c1">// Comments for explaining details.</span>
<a id="__codelineno-7-4" name="__codelineno-7-4" href="#__codelineno-7-4"></a>
<a id="__codelineno-7-5" name="__codelineno-7-5" href="#__codelineno-7-5"></a><span class="cm">/**</span>
<a id="__codelineno-7-6" name="__codelineno-7-6" href="#__codelineno-7-6"></a><span class="cm"> * multi-line</span>
<a id="__codelineno-7-7" name="__codelineno-7-7" href="#__codelineno-7-7"></a><span class="cm"> * marginal notes</span>
<a id="__codelineno-7-6" name="__codelineno-7-6" href="#__codelineno-7-6"></a><span class="cm"> * Multiline</span>
<a id="__codelineno-7-7" name="__codelineno-7-7" href="#__codelineno-7-7"></a><span class="cm"> * comments</span>
<a id="__codelineno-7-8" name="__codelineno-7-8" href="#__codelineno-7-8"></a><span class="cm"> */</span>
</code></pre></div>
</div>
<div class="tabbed-block">
<div class="highlight"><pre><span></span><code><a id="__codelineno-8-1" name="__codelineno-8-1" href="#__codelineno-8-1"></a><span class="cm">/* Header comments for labeling functions, classes, test samples, etc. */</span>
<div class="highlight"><pre><span></span><code><a id="__codelineno-8-1" name="__codelineno-8-1" href="#__codelineno-8-1"></a><span class="cm">/* Header comments for labeling functions, classes, test samples, etc */</span>
<a id="__codelineno-8-2" name="__codelineno-8-2" href="#__codelineno-8-2"></a>
<a id="__codelineno-8-3" name="__codelineno-8-3" href="#__codelineno-8-3"></a><span class="c1">// Content comments for detailed code solutions.</span>
<a id="__codelineno-8-3" name="__codelineno-8-3" href="#__codelineno-8-3"></a><span class="c1">// Comments for explaining details.</span>
<a id="__codelineno-8-4" name="__codelineno-8-4" href="#__codelineno-8-4"></a>
<a id="__codelineno-8-5" name="__codelineno-8-5" href="#__codelineno-8-5"></a><span class="cm">/**</span>
<a id="__codelineno-8-6" name="__codelineno-8-6" href="#__codelineno-8-6"></a><span class="cm"> * multi-line</span>
<a id="__codelineno-8-7" name="__codelineno-8-7" href="#__codelineno-8-7"></a><span class="cm"> * marginal notes</span>
<a id="__codelineno-8-6" name="__codelineno-8-6" href="#__codelineno-8-6"></a><span class="cm"> * Multiline</span>
<a id="__codelineno-8-7" name="__codelineno-8-7" href="#__codelineno-8-7"></a><span class="cm"> * comments</span>
<a id="__codelineno-8-8" name="__codelineno-8-8" href="#__codelineno-8-8"></a><span class="cm"> */</span>
</code></pre></div>
</div>
<div class="tabbed-block">
<div class="highlight"><pre><span></span><code><a id="__codelineno-9-1" name="__codelineno-9-1" href="#__codelineno-9-1"></a><span class="cm">/* Header comments for labeling functions, classes, test samples, etc. */</span>
<div class="highlight"><pre><span></span><code><a id="__codelineno-9-1" name="__codelineno-9-1" href="#__codelineno-9-1"></a><span class="cm">/* Header comments for labeling functions, classes, test samples, etc */</span>
<a id="__codelineno-9-2" name="__codelineno-9-2" href="#__codelineno-9-2"></a>
<a id="__codelineno-9-3" name="__codelineno-9-3" href="#__codelineno-9-3"></a><span class="c1">// Content comments for detailed code solutions.</span>
<a id="__codelineno-9-3" name="__codelineno-9-3" href="#__codelineno-9-3"></a><span class="c1">// Comments for explaining details.</span>
<a id="__codelineno-9-4" name="__codelineno-9-4" href="#__codelineno-9-4"></a>
<a id="__codelineno-9-5" name="__codelineno-9-5" href="#__codelineno-9-5"></a><span class="sd">/**</span>
<a id="__codelineno-9-6" name="__codelineno-9-6" href="#__codelineno-9-6"></a><span class="sd"> * multi-line</span>
<a id="__codelineno-9-7" name="__codelineno-9-7" href="#__codelineno-9-7"></a><span class="sd"> * marginal notes</span>
<a id="__codelineno-9-6" name="__codelineno-9-6" href="#__codelineno-9-6"></a><span class="sd"> * Multiline</span>
<a id="__codelineno-9-7" name="__codelineno-9-7" href="#__codelineno-9-7"></a><span class="sd"> * comments</span>
<a id="__codelineno-9-8" name="__codelineno-9-8" href="#__codelineno-9-8"></a><span class="sd"> */</span>
</code></pre></div>
</div>
<div class="tabbed-block">
<div class="highlight"><pre><span></span><code><a id="__codelineno-10-1" name="__codelineno-10-1" href="#__codelineno-10-1"></a><span class="cm">/* Header comments for labeling functions, classes, test samples, etc. */</span>
<div class="highlight"><pre><span></span><code><a id="__codelineno-10-1" name="__codelineno-10-1" href="#__codelineno-10-1"></a><span class="cm">/* Header comments for labeling functions, classes, test samples, etc */</span>
<a id="__codelineno-10-2" name="__codelineno-10-2" href="#__codelineno-10-2"></a>
<a id="__codelineno-10-3" name="__codelineno-10-3" href="#__codelineno-10-3"></a><span class="c1">// Content comments for detailed code solutions.</span>
<a id="__codelineno-10-3" name="__codelineno-10-3" href="#__codelineno-10-3"></a><span class="c1">// Comments for explaining details.</span>
<a id="__codelineno-10-4" name="__codelineno-10-4" href="#__codelineno-10-4"></a>
<a id="__codelineno-10-5" name="__codelineno-10-5" href="#__codelineno-10-5"></a><span class="cm">/**</span>
<a id="__codelineno-10-6" name="__codelineno-10-6" href="#__codelineno-10-6"></a><span class="cm"> * multi-line</span>
<a id="__codelineno-10-7" name="__codelineno-10-7" href="#__codelineno-10-7"></a><span class="cm"> * marginal notes</span>
<a id="__codelineno-10-6" name="__codelineno-10-6" href="#__codelineno-10-6"></a><span class="cm"> * Multiline</span>
<a id="__codelineno-10-7" name="__codelineno-10-7" href="#__codelineno-10-7"></a><span class="cm"> * comments</span>
<a id="__codelineno-10-8" name="__codelineno-10-8" href="#__codelineno-10-8"></a><span class="cm"> */</span>
</code></pre></div>
</div>
<div class="tabbed-block">
<div class="highlight"><pre><span></span><code><a id="__codelineno-11-1" name="__codelineno-11-1" href="#__codelineno-11-1"></a><span class="c1">// Header comments for labeling functions, classes, test samples, etc.</span>
<div class="highlight"><pre><span></span><code><a id="__codelineno-11-1" name="__codelineno-11-1" href="#__codelineno-11-1"></a><span class="c1">// Header comments for labeling functions, classes, test samples, etc</span>
<a id="__codelineno-11-2" name="__codelineno-11-2" href="#__codelineno-11-2"></a>
<a id="__codelineno-11-3" name="__codelineno-11-3" href="#__codelineno-11-3"></a><span class="c1">// Content comments for detailed code solutions.</span>
<a id="__codelineno-11-3" name="__codelineno-11-3" href="#__codelineno-11-3"></a><span class="c1">// Comments for explaining details.</span>
<a id="__codelineno-11-4" name="__codelineno-11-4" href="#__codelineno-11-4"></a>
<a id="__codelineno-11-5" name="__codelineno-11-5" href="#__codelineno-11-5"></a><span class="c1">// Multi-line</span>
<a id="__codelineno-11-6" name="__codelineno-11-6" href="#__codelineno-11-6"></a><span class="c1">// Annotation</span>
<a id="__codelineno-11-5" name="__codelineno-11-5" href="#__codelineno-11-5"></a><span class="c1">// Multiline</span>
<a id="__codelineno-11-6" name="__codelineno-11-6" href="#__codelineno-11-6"></a><span class="c1">// comments</span>
</code></pre></div>
</div>
</div>
</div>
<h2 id="022-learn-efficiently-in-animated-graphic-solutions">0.2.2 &nbsp; Learn Efficiently In Animated Graphic Solutions<a class="headerlink" href="#022-learn-efficiently-in-animated-graphic-solutions" title="Permanent link">&para;</a></h2>
<p>Compared with text, videos and pictures have a higher degree of information density and structure and are easier to understand. In this book, <strong>key and difficult knowledge will be presented mainly in the form of animations and graphs</strong>, while the text serves as an explanation and supplement to the animations and graphs.</p>
<p>If, while reading the book, you find that a particular paragraph provides an animation or a graphic solution as shown below, <strong>please use the figure as the primary source and the text as a supplement and synthesize the two to understand the content</strong>.</p>
<p><a class="glightbox" href="../../index.assets/animation.gif" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="Example animation" class="animation-figure" src="../../index.assets/animation.gif" /></a></p>
<p align="center"> Figure 0-2 &nbsp; Example animation </p>
<h2 id="022-efficient-learning-via-animated-illustrations">0.2.2 &nbsp; Efficient Learning via Animated Illustrations<a class="headerlink" href="#022-efficient-learning-via-animated-illustrations" title="Permanent link">&para;</a></h2>
<p>Compared with text, videos and pictures have a higher density of information and are more structured, making them easier to understand. In this book, <strong>key and difficult concepts are mainly presented through animations and illustrations</strong>, with text serving as explanations and supplements.</p>
<p>When encountering content with animations or illustrations as shown in the Figure 0-2 , <strong>prioritize understanding the figure, with text as supplementary</strong>, integrating both for a comprehensive understanding.</p>
<p><a class="glightbox" href="../../index.assets/animation.gif" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="Animated Illustration Example" class="animation-figure" src="../../index.assets/animation.gif" /></a></p>
<p align="center"> Figure 0-2 &nbsp; Animated Illustration Example </p>
<h2 id="023-deeper-understanding-in-code-practice">0.2.3 &nbsp; Deeper Understanding In Code Practice<a class="headerlink" href="#023-deeper-understanding-in-code-practice" title="Permanent link">&para;</a></h2>
<p>The companion code for this book is hosted in the <a href="https://github.com/krahets/hello-algo">GitHub repository</a>. As shown in the Figure 0-3 , <strong>the source code is accompanied by test samples that can be run with a single click</strong>.</p>
<p>If time permits, <strong>it is recommended that you refer to the code and knock it through on your own</strong>. If you have limited time to study, please read through and run all the code at least once.</p>
<p>The process of writing code is often more rewarding than reading it. <strong>Learning by doing is really learning</strong>.</p>
<p><a class="glightbox" href="../../index.assets/running_code.gif" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="Running code example" class="animation-figure" src="../../index.assets/running_code.gif" /></a></p>
<p align="center"> Figure 0-3 &nbsp; Running code example </p>
<h2 id="023-deepen-understanding-through-coding-practice">0.2.3 &nbsp; Deepen Understanding through Coding Practice<a class="headerlink" href="#023-deepen-understanding-through-coding-practice" title="Permanent link">&para;</a></h2>
<p>The source code of this book is hosted on the <a href="https://github.com/krahets/hello-algo">GitHub Repository</a>. As shown in the Figure 0-3 , <strong>the source code comes with test examples and can be executed with just a single click</strong>.</p>
<p>If time permits, <strong>it's recommended to type out the code yourself</strong>. If pressed for time, at least read and run all the codes.</p>
<p>Compared to just reading code, writing code often yields more learning. <strong>Learning by doing is the real way to learn.</strong></p>
<p><a class="glightbox" href="../../index.assets/running_code.gif" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="Running Code Example" class="animation-figure" src="../../index.assets/running_code.gif" /></a></p>
<p align="center"> Figure 0-3 &nbsp; Running Code Example </p>
<p>The preliminaries for running the code are divided into three main steps.</p>
<p><strong>Step 1: Install the local programming environment</strong>. Please refer to <a href="https://www.hello-algo.com/chapter_appendix/installation/">Appendix Tutorial</a> for installation, or skip this step if already installed.</p>
<p><strong>Step 2: Clone or download the code repository</strong>. If <a href="https://git-scm.com/downloads">Git</a> is already installed, you can clone this repository with the following command.</p>
<p>Setting up to run the code involves three main steps.</p>
<p><strong>Step 1: Install a local programming environment</strong>. Follow the <a href="https://www.hello-algo.com/chapter_appendix/installation/">tutorial</a> in the appendix for installation, or skip this step if already installed.</p>
<p><strong>Step 2: Clone or download the code repository</strong>. Visit the <a href="https://github.com/krahets/hello-algo">GitHub Repository</a>.</p>
<p>If <a href="https://git-scm.com/downloads">Git</a> is installed, use the following command to clone the repository:</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-12-1" name="__codelineno-12-1" href="#__codelineno-12-1"></a>git<span class="w"> </span>clone<span class="w"> </span>https://github.com/krahets/hello-algo.git
</code></pre></div>
<p>Of course, you can also in the location shown in the Figure 0-4 , click "Download ZIP" directly download the code zip, and then in the local solution.</p>
<p><a class="glightbox" href="../suggestions.assets/download_code.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="Clone repository with download code" class="animation-figure" src="../suggestions.assets/download_code.png" /></a></p>
<p align="center"> Figure 0-4 &nbsp; Clone repository with download code </p>
<p>Alternatively, you can also click the "Download ZIP" button at the location shown in the Figure 0-4 to directly download the code as a compressed ZIP file. Then, you can simply extract it locally.</p>
<p><a class="glightbox" href="../suggestions.assets/download_code.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="Cloning Repository and Downloading Code" class="animation-figure" src="../suggestions.assets/download_code.png" /></a></p>
<p align="center"> Figure 0-4 &nbsp; Cloning Repository and Downloading Code </p>
<p><strong>Step 3: Run the source code</strong>. As shown in the Figure 0-5 , for the code block labeled with the file name at the top, we can find the corresponding source code file in the <code>codes</code> folder of the repository. The source code files can be run with a single click, which will help you save unnecessary debugging time and allow you to focus on what you are learning.</p>
<p><a class="glightbox" href="../suggestions.assets/code_md_to_repo.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="Code block with corresponding source file" class="animation-figure" src="../suggestions.assets/code_md_to_repo.png" /></a></p>
<p align="center"> Figure 0-5 &nbsp; Code block with corresponding source file </p>
<p><strong>Step 3: Run the source code</strong>. As shown in the Figure 0-5 , for the code block labeled with the file name at the top, we can find the corresponding source code file in the <code>codes</code> folder of the repository. These files can be executed with a single click, which will help you save unnecessary debugging time and allow you to focus on learning.</p>
<p><a class="glightbox" href="../suggestions.assets/code_md_to_repo.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="Code Block and Corresponding Source Code File" class="animation-figure" src="../suggestions.assets/code_md_to_repo.png" /></a></p>
<p align="center"> Figure 0-5 &nbsp; Code Block and Corresponding Source Code File </p>
<h2 id="024-growing-together-in-questioning-and-discussion">0.2.4 &nbsp; Growing Together In Questioning And Discussion<a class="headerlink" href="#024-growing-together-in-questioning-and-discussion" title="Permanent link">&para;</a></h2>
<p>While reading this book, please don't skip over the points that you didn't learn. <strong>Feel free to ask your questions in the comment section</strong>. We will be happy to answer them and can usually respond within two days.</p>
<p>As you can see in the Figure 0-6 , each post comes with a comment section at the bottom. I hope you'll pay more attention to the comments section. On the one hand, you can learn about the problems that people encounter, so as to check the gaps and stimulate deeper thinking. On the other hand, we expect you to generously answer other partners' questions, share your insights, and help others improve.</p>
<p><a class="glightbox" href="../../index.assets/comment.gif" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="Example of comment section" class="animation-figure" src="../../index.assets/comment.gif" /></a></p>
<p align="center"> Figure 0-6 &nbsp; Example of comment section </p>
<h2 id="024-learning-together-in-discussion">0.2.4 &nbsp; Learning Together in Discussion<a class="headerlink" href="#024-learning-together-in-discussion" title="Permanent link">&para;</a></h2>
<p>While reading this book, please don't skip over the points that you didn't learn. <strong>Feel free to post your questions in the comment section</strong>. We will be happy to answer them and can usually respond within two days.</p>
<p>As illustrated in the Figure 0-6 , each chapter features a comment section at the bottom. I encourage you to pay attention to these comments. They not only expose you to others' encountered problems, aiding in identifying knowledge gaps and sparking deeper contemplation, but also invite you to generously contribute by answering fellow readers' inquiries, sharing insights, and fostering mutual improvement.</p>
<p><a class="glightbox" href="../../index.assets/comment.gif" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="Comment Section Example" class="animation-figure" src="../../index.assets/comment.gif" /></a></p>
<p align="center"> Figure 0-6 &nbsp; Comment Section Example </p>
<h2 id="025-algorithm-learning-route">0.2.5 &nbsp; Algorithm Learning Route<a class="headerlink" href="#025-algorithm-learning-route" title="Permanent link">&para;</a></h2>
<p>From a general point of view, we can divide the process of learning data structures and algorithms into three stages.</p>
<h2 id="025-algorithm-learning-path">0.2.5 &nbsp; Algorithm Learning Path<a class="headerlink" href="#025-algorithm-learning-path" title="Permanent link">&para;</a></h2>
<p>Overall, the journey of mastering data structures and algorithms can be divided into three stages:</p>
<ol>
<li><strong>Introduction to Algorithms</strong>. We need to familiarize ourselves with the characteristics and usage of various data structures and learn about the principles, processes, uses and efficiency of different algorithms.</li>
<li><strong>Brush up on algorithm questions</strong>. It is recommended to start brushing from popular topics, such as <a href="https://leetcode.cn/studyplan/coding-interviews/">Sword to Offer</a> and <a href="https://leetcode.cn/studyplan/top-100- liked/">LeetCode Hot 100</a>, first accumulate at least 100 questions to familiarize yourself with mainstream algorithmic problems. Forgetfulness can be a challenge when first brushing up, but rest assured that this is normal. We can follow the "Ebbinghaus Forgetting Curve" to review the questions, and usually after 3-5 rounds of repetitions, we will be able to memorize them.</li>
<li><strong>Build the knowledge system</strong>. In terms of learning, we can read algorithm column articles, solution frameworks and algorithm textbooks to continuously enrich the knowledge system. In terms of brushing, we can try to adopt advanced brushing strategies, such as categorizing by topic, multiple solutions, multiple solutions, etc. Related brushing tips can be found in various communities.</li>
<li><strong>Stage 1: Introduction to algorithms</strong>. We need to familiarize ourselves with the characteristics and usage of various data structures and learn about the principles, processes, uses, and efficiency of different algorithms.</li>
<li><strong>Stage 2: Practicing algorithm problems</strong>. It is recommended to start from popular problems, such as <a href="https://leetcode.cn/studyplan/coding-interviews/">Sword for Offer</a> and <a href="https://leetcode.cn/studyplan/top-100- liked/">LeetCode Hot 100</a>, and accumulate at least 100 questions to familiarize yourself with mainstream algorithmic problems. Forgetfulness can be a challenge when you start practicing, but rest assured that this is normal. We can follow the "Ebbinghaus Forgetting Curve" to review the questions, and usually after 3~5 rounds of repetitions, we will be able to memorize them.</li>
<li><strong>Stage 3: Building the knowledge system</strong>. In terms of learning, we can read algorithm column articles, solution frameworks, and algorithm textbooks to continuously enrich the knowledge system. In terms of practicing, we can try advanced strategies, such as categorizing by topic, multiple solutions for a single problem, and one solution for multiple problems, etc. Insights on these strategies can be found in various communities.</li>
</ol>
<p>As shown in the Figure 0-7 , this book mainly covers "Phase 1" and is designed to help you start Phase 2 and 3 more efficiently.</p>
<p><a class="glightbox" href="../suggestions.assets/learning_route.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="algorithm learning route" class="animation-figure" src="../suggestions.assets/learning_route.png" /></a></p>
<p align="center"> Figure 0-7 &nbsp; algorithm learning route </p>
<p>As shown in the Figure 0-7 , this book mainly covers “Stage 1,” aiming to help you more efficiently embark on Stages 2 and 3.</p>
<p><a class="glightbox" href="../suggestions.assets/learning_route.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="Algorithm Learning Path" class="animation-figure" src="../suggestions.assets/learning_route.png" /></a></p>
<p align="center"> Figure 0-7 &nbsp; Algorithm Learning Path </p>
<!-- Source file information -->