Skip to content

Commit

Permalink
image?
Browse files Browse the repository at this point in the history
  • Loading branch information
little612pea committed Nov 19, 2023
1 parent 6033d47 commit 8913a0d
Show file tree
Hide file tree
Showing 32 changed files with 4,994 additions and 3,639 deletions.
File renamed without changes
Binary file added docs/Others/assets/image-20231119131157151.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion docs/Others/git使用教程.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# git使用教程

![image-20231119120457827](D:\jy_learning_site\docs\Others\assets\image-20231119120457827.png)
docs\pictures\1.jpg

![image-20231119131157151](D:\jy_learning_site\docs\Others\assets\image-20231119131157151.png)
Binary file added docs/pictures/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/welcome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 欢迎来到jy-hf的代码空间

本学习网站使用mkdocs-material搭建,建站教程请见 [mkdocs.org](https://www.mkdocs.org).
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ markdown_extensions:
- pymdownx.keys
- pymdownx.superfences
- pymdownx.tasklist
- markdown.extensions.extra
#python markdown 无法显示内联公式,需要使用pymdownx.arithmatex
- pymdownx.arithmatex:
generic: true
Expand Down
1,517 changes: 763 additions & 754 deletions site/2 数据结构/mynotes/FDS-notes/index.html

Large diffs are not rendered by default.

102 changes: 51 additions & 51 deletions site/2 数据结构/webnotes/DS WEEK01/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1490,11 +1490,11 @@ <h4 id="definition-an-algorithm-is-a-finite-set-of-instructions-that-if-followed
</li>
</ol>
<h4 id="example-selection-sort-sort-a-set-of-ngeq1-integers-in-increasing-order">[Example] Selection Sort : Sort a set of <span class="arithmatex">\(n\geq1\)</span> integers in increasing order</h4>
<div class="highlight"><pre><span></span><code>for (i = 0; i &lt; n; i++){
<pre><code class="language-pseudocode">for (i = 0; i &lt; n; i++){
Examine list[i] to list[n-1] and suppose that the smallest integer is at list[min];
Interchange list[i] and list[min];
}
</code></pre></div>
</code></pre>
<hr />
<h3 id="11-what-to-analyze">1.1 What to Analyze</h3>
<ul>
Expand Down Expand Up @@ -1523,47 +1523,47 @@ <h3 id="11-what-to-analyze">1.1 What to Analyze</h3>
<li><span class="arithmatex">\(T_{avg}(N)\, and\, T_{worst}(N)\)</span> : the average and worst case time complexities as functions of input size <span class="arithmatex">\(N\)</span></li>
</ul>
<h4 id="example-matrix-addition">[Example] Matrix addition</h4>
<div class="highlight"><pre><span></span><code><span class="kt">void</span><span class="w"> </span><span class="nf">add</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">a</span><span class="p">[][</span><span class="n">MAX_SIZE</span><span class="p">],</span>
<span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">b</span><span class="p">[][</span><span class="n">MAX_SIZE</span><span class="p">],</span>
<span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">c</span><span class="p">[][</span><span class="n">MAX_SIZE</span><span class="p">],</span>
<span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">rows</span><span class="p">,</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">cols</span><span class="p">)</span><span class="w"> </span>
<span class="p">{</span>
<span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="n">j</span><span class="p">;</span>
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">&lt;</span><span class="n">rows</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="cm">/*rows+1*/</span>
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">j</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span><span class="n">j</span><span class="o">&lt;</span><span class="n">cols</span><span class="p">;</span><span class="n">j</span><span class="o">++</span><span class="p">)</span><span class="cm">/*rows(cols+1)*/</span>
<span class="w"> </span><span class="n">c</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">a</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span><span class="o">+</span><span class="n">b</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">];</span><span class="cm">/*rows*cols*/</span>
<span class="p">}</span>
</code></pre></div>
<pre><code class="language-c">void add(int a[][MAX_SIZE],
int b[][MAX_SIZE],
int c[][MAX_SIZE],
int rows, int cols)
{
int i, j;
for (i=0; i&lt;rows; i++)/*rows+1*/
for (j=0;j&lt;cols;j++)/*rows(cols+1)*/
c[i][j] = a[i][j]+b[i][j];/*rows*cols*/
}
</code></pre>
<div class="arithmatex">\[
T(rows, cols) = 2rows\times cols + 2rows+1
\]</div>
<ul>
<li>非对称</li>
</ul>
<h4 id="example-iterative-function-for-summing-a-list-of-numbers">[Example] Iterative function for summing a list of numbers</h4>
<div class="highlight"><pre><span></span><code><span class="kt">float</span><span class="w"> </span><span class="nf">sum</span><span class="w"> </span><span class="p">(</span><span class="kt">float</span><span class="w"> </span><span class="n">list</span><span class="p">[],</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">n</span><span class="p">)</span>
<span class="p">{</span><span class="w"> </span><span class="cm">/*add a list of numbers*/</span>
<span class="w"> </span><span class="kt">float</span><span class="w"> </span><span class="n">tempsum</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="cm">/*count = 1*/</span>
<span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="p">;</span>
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">&lt;</span><span class="n">n</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span>
<span class="w"> </span><span class="cm">/*count++*/</span>
<span class="w"> </span><span class="n">tempsum</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="n">list</span><span class="p">[</span><span class="n">i</span><span class="p">];</span><span class="w"> </span><span class="cm">/*count++*/</span>
<span class="w"> </span><span class="cm">/*count++ for last excutaion of for*/</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">tempsum</span><span class="p">;</span><span class="w"> </span><span class="cm">/*count++*/</span>
<span class="p">}</span>
</code></pre></div>
<pre><code class="language-c">float sum (float list[], int n)
{ /*add a list of numbers*/
float tempsum = 0; /*count = 1*/
int i;
for (i=0; i&lt;n; i++)
/*count++*/
tempsum += list[i]; /*count++*/
/*count++ for last excutaion of for*/
return tempsum; /*count++*/
}
</code></pre>
<div class="arithmatex">\[
T_{sum}(n)=2n+3
\]</div>
<h4 id="example-recursive-function-for-summing-a-list-of-numbers">[Example] Recursive function for summing a list of numbers</h4>
<div class="highlight"><pre><span></span><code><span class="kt">float</span><span class="w"> </span><span class="nf">rsum</span><span class="w"> </span><span class="p">(</span><span class="kt">float</span><span class="w"> </span><span class="n">list</span><span class="p">[],</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">n</span><span class="p">)</span>
<span class="p">{</span><span class="cm">/*add a list of numbers*/</span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">n</span><span class="p">)</span><span class="w"> </span><span class="cm">/*count++*/</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">rsum</span><span class="p">(</span><span class="n">list</span><span class="p">,</span><span class="w"> </span><span class="n">n</span><span class="mi">-1</span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">list</span><span class="p">[</span><span class="n">n</span><span class="mi">-1</span><span class="p">];</span>
<span class="w"> </span><span class="cm">/*count++*/</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="cm">/*count++*/</span>
<span class="p">}</span>
</code></pre></div>
<pre><code class="language-c">float rsum (float list[], int n)
{/*add a list of numbers*/
if (n) /*count++*/
return rsum(list, n-1) + list[n-1];
/*count++*/
return 0; /*count++*/
}
</code></pre>
<div class="arithmatex">\[
T_{rsum}(n)=2n+2
\]</div>
Expand Down Expand Up @@ -1606,17 +1606,17 @@ <h4 id="definition-tnopn-if-tnopn-and-tnneqthetapn">[Definition] <span class="ar
<p><img src="picture/1-1.png" alt="1-1" style="zoom: 45%;" /></p>
<p><img src="picture/1-2.png" alt="1-2" style="zoom:43%;" /></p>
<h4 id="example-matrix-addition_1">[Example] Matrix addition</h4>
<div class="highlight"><pre><span></span><code><span class="kt">void</span><span class="w"> </span><span class="nf">add</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">a</span><span class="p">[][</span><span class="n">MAX_SIZE</span><span class="p">],</span>
<span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">b</span><span class="p">[][</span><span class="n">MAX_SIZE</span><span class="p">],</span>
<span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">c</span><span class="p">[][</span><span class="n">MAX_SIZE</span><span class="p">],</span>
<span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">rows</span><span class="p">,</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">cols</span><span class="p">)</span><span class="w"> </span>
<span class="p">{</span>
<span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="n">j</span><span class="p">;</span>
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">&lt;</span><span class="n">rows</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span>
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">j</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span><span class="n">j</span><span class="o">&lt;</span><span class="n">cols</span><span class="p">;</span><span class="n">j</span><span class="o">++</span><span class="p">)</span>
<span class="w"> </span><span class="n">c</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">a</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span><span class="o">+</span><span class="n">b</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">];</span>
<span class="p">}</span>
</code></pre></div>
<pre><code class="language-C">void add(int a[][MAX_SIZE],
int b[][MAX_SIZE],
int c[][MAX_SIZE],
int rows, int cols)
{
int i, j;
for (i=0; i&lt;rows; i++)
for (j=0;j&lt;cols;j++)
c[i][j] = a[i][j]+b[i][j];
}
</code></pre>
<div class="arithmatex">\[
T(rows,cols)=\Theta(rows\cdot cols)
\]</div>
Expand Down Expand Up @@ -1647,14 +1647,14 @@ <h4 id="general-rules">General Rules</h4>
$$
Fib(0)=Fib(1)=1, Fib(n)=Fib(n-1)+Fib(n-2)
$$</p>
<div class="highlight"><pre><span></span><code><span class="n">lont</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">Fib</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">N</span><span class="p">)</span><span class="w"> </span><span class="cm">/*T(N)*/</span>
<span class="p">{</span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">N</span><span class="o">&lt;=</span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="cm">/*O(1)*/</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"> </span><span class="cm">/*O(1)*/</span>
<span class="w"> </span><span class="k">else</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">Fib</span><span class="p">(</span><span class="n">N</span><span class="mi">-1</span><span class="p">)</span><span class="o">+</span><span class="n">Fib</span><span class="p">(</span><span class="n">N</span><span class="mi">-2</span><span class="p">);</span>
<span class="p">}</span><span class="w"> </span><span class="cm">/*O(1)*//*T(N-1)*//*T(N-2)*/</span>
</code></pre></div>
<p><code>c
lont int Fib (int N) /*T(N)*/
{
if (N&lt;=1) /*O(1)*/
return 1; /*O(1)*/
else
return Fib(N-1)+Fib(N-2);
} /*O(1)*//*T(N-1)*//*T(N-2)*/</code></p>
<p>$$
T(N)=T(N-1)+T(N-2)+2\geq Fib(N)\
\left(\frac{3}{2} \right)^n\leq Fib(N)\leq\left(\frac{5}{3}\right)^n
Expand Down
Loading

0 comments on commit 8913a0d

Please sign in to comment.