From a88870d347f5f684d5e67e858947ffb093b3594e Mon Sep 17 00:00:00 2001 From: Firisy Feng Date: Wed, 3 Jul 2024 19:05:15 +0800 Subject: [PATCH] try pdf new --- .github/workflows/ci.yml | 1 + .../WLab1/WLab1.md" | 2 +- .../preview.md" | 21 +- .../Preview.md" | 2 + docs/JY_FENG/JY-Feng.md | 26 +- docs/stylesheets/singlePageTemplate.css | 1 + mkdocs.yml | 2 + .../index.html" | 44 +- .../index.html" | 84 +- .../index.html" | 124 +- .../index.html" | 152 +- .../index.html" | 36 +- .../index.html" | 112 +- .../WLab1/WLab1/index.html" | 2 +- .../lab7/index.html" | 26 +- .../preview/index.html" | 40 +- .../Lab5/Lab5/index.html" | 4 +- .../Lab6/Lab6/index.html" | 4 +- .../Lab7/Lab7/index.html" | 4 +- .../Lab9/Lab9/index.html" | 4 +- .../Preview/index.html" | 2584 +++++++++++++++++ site/JY_FENG/JY-Feng/index.html | 25 +- .../index.html" | 18 +- .../index.html" | 12 +- .../exams/15-16-middle/index.html" | 163 +- .../exams/16-17-middle/index.html" | 139 +- .../exams/17-18-middle/index.html" | 141 +- .../exams/18-19-middle/index.html" | 173 +- .../exams/19-20-middle/index.html" | 161 +- .../mynotes/FDS-notes/index.html" | 60 +- .../mynotes/midterm/index.html" | 56 +- .../webnotes/DS WEEK01/index.html" | 14 +- .../webnotes/DS WEEK02/index.html" | 24 +- .../webnotes/DS WEEK03/index.html" | 36 +- .../webnotes/DS WEEK04/index.html" | 12 +- .../webnotes/DS WEEK05/index.html" | 14 +- .../webnotes/DS WEEK06/index.html" | 34 +- .../webnotes/DS WEEK07/index.html" | 24 +- .../webnotes/DS WEEK08/index.html" | 28 +- .../webnotes/DS WEEK09/index.html" | 16 +- .../webnotes/DS WEEK10/index.html" | 12 +- .../webnotes/DS WEEK11/index.html" | 24 +- .../webnotes/DS WEEK12/index.html" | 12 +- .../webnotes/DS WEEK13/index.html" | 28 +- .../webnotes/DS WEEK14/index.html" | 24 +- .../webnotes/DS WEEK15/index.html" | 14 +- .../Foundation-of-Data-Structure/index.html" | 276 +- .../webnotes/index.html" | 12 +- .../3 ZJU-AI-ML/Approach almost/index.html | 4 +- site/JY_HU/3 ZJU-AI-ML/ML-zju/index.html | 16 +- .../index.html | 4 +- .../DIP/index.html" | 4 +- site/Others/CS61A-python/index.html | 52 +- site/Others/content block example/index.html | 24 +- .../index.html" | 14 +- .../index.html" | 22 +- site/Others/memories/index.html | 12 +- site/mkdocs-guide/index.html | 8 +- site/stylesheets/singlePageTemplate.css | 1 + 59 files changed, 3832 insertions(+), 1156 deletions(-) create mode 100644 "docs/JY_FENG/3 \347\224\265\347\275\221\347\273\234\345\210\206\346\236\220/Preview.md" create mode 100644 "site/JY_FENG/3 \347\224\265\347\275\221\347\273\234\345\210\206\346\236\220/Preview/index.html" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04524343..ed2a45bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,4 +23,5 @@ jobs: - run: python -m pip install --upgrade pip - run: pip install mkdocs-material - run: pip install mkdocs-git-revision-date-localized-plugin + - run: pip install pip install mkdocs-pdf - run: mkdocs gh-deploy --force \ No newline at end of file diff --git "a/docs/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/WLab1/WLab1.md" "b/docs/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/WLab1/WLab1.md" index f7900261..8cb7764d 100644 --- "a/docs/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/WLab1/WLab1.md" +++ "b/docs/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/WLab1/WLab1.md" @@ -1 +1 @@ - \ No newline at end of file +![WLab1.pdf](./WLab1.pdf){ type=application/pdf style="height:600px;width:100%" } \ No newline at end of file diff --git "a/docs/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/preview.md" "b/docs/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/preview.md" index e8941296..8130f3b1 100644 --- "a/docs/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/preview.md" +++ "b/docs/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/preview.md" @@ -1,3 +1,22 @@ ## 写在前面 for 电路与电子技术实验I -电院实验课本身内容并不复杂,具体操作老师基本上会给出,但是完成实验并得到效果还是一个比较繁琐的内容,再加上对实验报告有一定的要求, \ No newline at end of file +电院实验课本身内容并不复杂,具体操作老师基本上会给出,但是完成实验并得到效果还是一个比较繁琐的内容,再加上对实验报告有一定的要求,所以会觉得这2学分的课实在是性价比过高。 + +综合实验报告成绩和两次考核成绩,本人最终成绩为94,所以可以以此为基准参考需要的努力程度。 + +综合一年的实验感受,实验报告总的完成以下两点要求差不多就可以拿到一个不错的成绩: + +* 实验内容不缺不漏 +* 实验结果准确无误,和理论基本一致 + +#### 学习内容 + +**秋学期**:综合实验,各类内容均有涉及,主要目的是了解实验器材,然后对”电“有一定的概念。祁才军老师负责,但应该教完我们这一届就退休了。期末考试内容涉及PPT内容较多,认真阅读PPT,对期末考试有较大帮助。 + +**冬学期**:电路原理部分实验。实际上涉及较多模电实验的内容。姚缨英老师主要负责。姚老师虽然看上去事情很多,实际上事情也是真的多。PPT上的实验内容也比较杂乱,但可以根据往届的实验报告推测老师的实验要求。同时有任何不理解的内容和要求,也建议主动问姚老师。姚老师会非常耐心地解答。 + +#### 考试 + +**秋学期**:期末考试以笔试形式考察秋学期的所有实验内容,认真阅读PPT + +**冬学期**:姚老师基本上会以各种方式提示期末考试的内容 \ No newline at end of file diff --git "a/docs/JY_FENG/3 \347\224\265\347\275\221\347\273\234\345\210\206\346\236\220/Preview.md" "b/docs/JY_FENG/3 \347\224\265\347\275\221\347\273\234\345\210\206\346\236\220/Preview.md" new file mode 100644 index 00000000..d3afd3f4 --- /dev/null +++ "b/docs/JY_FENG/3 \347\224\265\347\275\221\347\273\234\345\210\206\346\236\220/Preview.md" @@ -0,0 +1,2 @@ +# 写在前面 for 电网络分析 + diff --git a/docs/JY_FENG/JY-Feng.md b/docs/JY_FENG/JY-Feng.md index 31c25443..3cf05200 100644 --- a/docs/JY_FENG/JY-Feng.md +++ b/docs/JY_FENG/JY-Feng.md @@ -1,4 +1,22 @@ -```py -import sys -print(sys.exeutation) -``` \ No newline at end of file +编写者为ZJU 22级电子信息工程专业学生,由于加入爱迪生班,所以内容主要面向爱迪生班专业内容(爱迪生班内容会在后面标注$\alpha$)。 + +这里作为我对本专业的回顾,以及一些经验~ + +专业课大致内容如下:(打勾内容为已更新) + +* 电路与电子技术I与II**实验**($\alpha$) 实验报告 ✓ +* 电网络分析($\alpha$) 课程内容与拓展 +* 电路与电子技术I与II($\alpha$)一些笔记和经验之谈 +* 工程电磁场与波 +* 微机原理及应用($\alpha$) +* 微机原理及应用综合实验($\alpha$) +* 信号分析与处理实验($\alpha$),【为什么没有理论课?因为我恨傅里叶】 +* ...... + +各类通识课: + +* 微观经济学原理 +* 概率论及数理统计 +* 微积分 +* 大学物理 +* ...... \ No newline at end of file diff --git a/docs/stylesheets/singlePageTemplate.css b/docs/stylesheets/singlePageTemplate.css index fe35c109..1a40b316 100644 --- a/docs/stylesheets/singlePageTemplate.css +++ b/docs/stylesheets/singlePageTemplate.css @@ -65,6 +65,7 @@ .hero_header { font-size: 1.3rem; /* Adjust width for smaller screens */ + letter-spacing: 2px; } .tagline { diff --git a/mkdocs.yml b/mkdocs.yml index 91d8997d..488833c5 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -142,6 +142,7 @@ extra_css: markdown_extensions: - admonition + - attr_list - pymdownx.arithmatex: generic: true - pymdownx.details @@ -175,3 +176,4 @@ plugins: enable_creation_date: true type: timeago enabled: true + - mkdocs-pdf diff --git "a/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab1/Lab1 \345\270\270\347\224\250\344\273\252\345\231\250\344\275\277\347\224\250\347\273\203\344\271\240\345\256\236\351\252\214/index.html" "b/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab1/Lab1 \345\270\270\347\224\250\344\273\252\345\231\250\344\275\277\347\224\250\347\273\203\344\271\240\345\256\236\351\252\214/index.html" index 4dbecb50..d2127398 100644 --- "a/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab1/Lab1 \345\270\270\347\224\250\344\273\252\345\231\250\344\275\277\347\224\250\347\273\203\344\271\240\345\256\236\351\252\214/index.html" +++ "b/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab1/Lab1 \345\270\270\347\224\250\344\273\252\345\231\250\344\275\277\347\224\250\347\273\203\344\271\240\345\256\236\351\252\214/index.html" @@ -3024,7 +3024,7 @@ -

常用仪器使用练习实验

+

常用仪器使用练习实验

实验日期:2023/9/18

地点:东3-406

实验目的

@@ -3059,7 +3059,7 @@
测试过程
  • 选取不同的电阻,重复2~4步。
  • 测试结果
    -

    +

    这些电阻为五道色环对应读数

    @@ -3090,7 +3090,7 @@
    测试结果
    结果分析

    使用万用表欧姆档所测量的电阻阻值与标称阻值略有偏差,但均在允许误差范围内。

    -
    +

    (二)电位器(M) 中心头的功能

    测试过程与测试结果
      @@ -3104,12 +3104,12 @@
      测试过程与测试结果

      将黑色表笔插入电位器位于中心的孔,红表笔插入两旁的孔。

    -

    +

    1. 旋转电位器旋钮,发现万能表示数发生变化。

    我们观察到阻值从8.71KΩ,变至10.15KΩ。

    -

    +

    1. 调换红表笔至另一端的插孔,发现读书变为0,反方向旋转电位器,示数增大。

      @@ -3120,7 +3120,7 @@
      测试过程与测试结果
    结果分析

    旋转电位器,能够改变电位器的阻值。中心头应该起到调节短路部分电阻的作用,从而使得电位器阻值发生变化。

    -
    +

    (三)测量电容漏电阻

    理想电容在充满电的情况下,应该完全绝缘,但实际情况并非如此,仍有一定量的电流通过,说明此时电容存在一个电阻,这个电阻被称为漏电阻。从以上分析也可以知道,电容的漏电阻应该非常大,所以选取的万用表欧姆最大档进行测量。在测验过程中,也选择过较小档位,但是,很快就会出现OL显示,说明电容的漏电阻非常大。

    测试过程
    @@ -3151,7 +3151,7 @@
    测试结果与分析
    -
    +

    (四)调节稳压电源输出 +/-12V

    测试过程与测试结果
      @@ -3159,10 +3159,10 @@
      测试过程与测试结果
    1. 将万用表切换至60V电压档,将红表笔与电源正极连接,黑表笔与负极连接,按输出按钮,测得读数12.09V,此时电源的电流示数自动跳为0A
    2. 再按一次输出按钮,停止电源输出,交换红黑表笔,再按输出按钮,此时,万用表显示-12.09V
    -

    IMG_8752

    +

    IMG_8752

    结果分析

    想要输出-12V,实际上只需要交换正常的输出方式即可

    -
    +

    实验2:示波器和信号源的联合使用I

    实验器材

      @@ -3182,7 +3182,7 @@

      (一)探头补偿信号自检

    1. AutoScale按钮,将波形稳定地显示在屏幕上。
    2. 点按Meas按钮进行数据测量。
    -

    +

    @@ -3216,7 +3216,7 @@
    操作过程
  • 更换信号源信号,重新测量。
  • 数据记录与分析
    -

    234

    +

    234

    @@ -3259,7 +3259,7 @@
    数据记录与分析

    可见,信号源输出有一定误差,当然示波器检测也有一定的误差,导致测量值与所设想不同。

    -
    +

    实验3:示波器和信号源的联合使用II

    实验器材

      @@ -3270,7 +3270,7 @@

      实验器材

    1. 10kΩ的电阻U~R~

    实验方案

    -

    截屏2023-09-21 18.51.58

    +

    截屏2023-09-21 18.51.58

    实验电路图如上。调节信号源为正弦函数,并且将信号频率分别调至10, 10^2^, 10^3^, 10^4^, 10^5^, 10^6^kHz,并将示波器探测头两端并联在阻值R处,利用自带的测试工具,测量出U~R~的有效值,并绘图,得出结论。

    实验过程

      @@ -3279,7 +3279,7 @@

      实验过程

    1. 观察示波器波形,使用上一个实验中的调节方法,至波形稳定,并测量出实际的有效值大小。
    2. 调至不同频率,重复上述实验。
    -

    +

    实验过程中发现,当频率为10Hz时,示波器中显示的波形噪声非常大(如上图显示),因此,使用了trigger按键中,降低噪声的按钮,从而能够较好地测量出有效值,而非显示屏数字一直上下跳动。

    实验结果

    @@ -3317,10 +3317,10 @@

    实验结果

    根据以上数据,绘制出数据图

    -

    +

    结论

    电阻两端的有效值随着信号源频率的升高先是缓慢上升,然后在10^2^~10^4^区间快速上升,最后趋于平缓,直至近似于电压源的有效值。体现出电容“隔直流,通交流”或者“通高频,阻低频”的特性。

    -
    +

    探究性实验:万用表电流档

    实验目的

    探究万用表电流档(以6mA和60mA为例)内部阻值对测量结果的影响。

    @@ -3343,7 +3343,7 @@
    (一)探究不同电流档对真值的影响
  • 调节电源电压为6.00V。
  • 分别使用万用表的6mA和60mA档测量电路中的电流大小。
  • -

    截屏2023-09-23 16.12.04

    +

    截屏2023-09-23 16.12.04

    结果如下:

    @@ -3385,7 +3385,7 @@
    实验过程
  • 断开电路,由于R~B~不能显示电阻,所以使用了万用表欧姆档测量其电阻,得到结果即可近似为电流表内阻。
  • 将电流表档位调为6mA,重复2~4步,其中第2步中电流表显示改为6mA(实验过程中,发现6mA可以调到所以没有考虑减小),第3步改为3mA。
  • -

    截屏2023-09-23 16.47.02

    +

    截屏2023-09-23 16.47.02

    实验结果
    @@ -3446,8 +3446,8 @@
    实验误差分析

    而6mA的误差只会更小,所以可以考虑选用半偏法进行测量。

    最后我们发现,60mA档的6mA档内部的阻值相差十倍。因此在平时选用合理档位测量电路中的电流时应该妥善选择量程。

    结合电流表的组装,即将一个微小电流表和分流电阻并连的结构可知,量程越大相对应的阻值越小。

    -

    截屏2023-09-23 22.56.17

    -
    +

    截屏2023-09-23 22.56.17

    +

    示波器显示李萨如图像

    实验目的

    学会利用示波器上的Acquire键,调节出两个信号源合并之后的李萨如图像。

    @@ -3463,13 +3463,13 @@

    测试过程和结果

  • 然后调制信号源输出波形均为1kHz的正弦波,然后点按输出键。
  • 按示波器中的AutoScale按钮,然后发现两列波稳定地显示在屏幕上。
  • -

    +

    1. 点按Acquire按钮,然后将时间模式调为XY显示,随后,发现示波器界面并没有变成预想的直线,后意识到,输出的波形并没有同相位,因此只要在信号源中点按同相位即可。
    2. 调制不同相位差及频率之比的波形,重复2~3步。

    实验结果

    -

    截屏2023-09-23 23.01.58

    +

    截屏2023-09-23 23.01.58

    diff --git "a/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab2/Lab2 \345\215\212\345\257\274\344\275\223\344\272\214\346\236\201\347\256\241\347\211\271\346\200\247\346\265\213\350\257\225/index.html" "b/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab2/Lab2 \345\215\212\345\257\274\344\275\223\344\272\214\346\236\201\347\256\241\347\211\271\346\200\247\346\265\213\350\257\225/index.html" index ecf57213..c93de5ad 100644 --- "a/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab2/Lab2 \345\215\212\345\257\274\344\275\223\344\272\214\346\236\201\347\256\241\347\211\271\346\200\247\346\265\213\350\257\225/index.html" +++ "b/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab2/Lab2 \345\215\212\345\257\274\344\275\223\344\272\214\346\236\201\347\256\241\347\211\271\346\200\247\346\265\213\350\257\225/index.html" @@ -2826,7 +2826,7 @@ -

    半导体⼆极管特性测试

    +

    半导体⼆极管特性测试

    实验日期:2023/9/26

    地点:东3-406

    实验目的

    @@ -2861,13 +2861,13 @@

    实验方案

    1. 应⽤MULTISIM软件仿真⼆极管的VA特性。
    -
    +

    实验一:应⽤万⽤表初步测试⼆极管的好坏

    测试过程与结果

    1. 认识万用表测量二极管档
    -

    截屏2023-09-27 18.45.41截屏2023-09-27 18.47.04

    +

    截屏2023-09-27 18.45.41截屏2023-09-27 18.47.04

    1. 将黑表笔插入COM口,红表笔插入二极管测试对应二极管测试插口,并将档位调至二极管测量档位。由于蜂鸣器档位和二极管是同一档位,点按左上角Select按钮,切换至二极管档位。

      @@ -2876,28 +2876,28 @@

      测试过程与结果

      将万用表红表笔接入1N4007正级,黑色接负极,此时万用表显示二极管导通电压。如下图所示,测得1N4007的正向导通电压约为0.568V。

    -

    +

    1. 将红黑表笔交换,测量方向电压,如下图所示,显示OL,超出量程。
    -

    +

    1. 利用相同方法测量稳压二极管,得到相似结果
    -

    IMG_9034

    +

    IMG_9034

    结果分析

    首先通过万用表可以很好地对二极管进行检测,如检验其是否被击穿。同时可以看到,在同样的测量条件下,稳压二极管比整流二极管正向导通电压要高。可以与课上所给的VA特性曲线相联系,万用表所提供的电压为三伏,稳压二极管导通后,电压将保持0.7V左右,而整流二极管的曲线类似于大电阻,因而万用表显示的电压值在0.568V。

    -
    +

    实验二:逐点法测量二极管VA特性曲线

    实验方案

    采用以下电路,利用欧姆定律对二极管在每一点电压下的阻值进行测量。最后利用excel对数据进行处理,绘制曲线。

    -

    截屏2023-10-02 12.43.34

    +

    截屏2023-10-02 12.43.34

    由于万用表的安培表阻值在该测试条件下(mA级别),视为短路;而相反,电压表的阻值足够大,可以视为开路,所以实验中只使用电压表来进行测量,将电压表并联在R~1~两端。并且利用电压源的示数,通过计算得出二极管两端电压与电流。

    测试过程与结果

    1. 连接电路,并将电压源输出值调为0。
    -

    +

    1. 将万用表并联在电阻两端,测得电压示数。将此示数和电压源示数,一起记录到excel表格中。

      @@ -3084,8 +3084,8 @@

      数据处理与分析

    -

    截屏2023-10-02 12.56.02

    -
    +

    截屏2023-10-02 12.56.02

    +

    实验三:扫描法测量二极管VA特性曲线

    实验方案

      @@ -3097,7 +3097,7 @@

      实验方案

      后通过matlab等数据处理,生成正确的曲线。

    -

    截屏2023-10-02 15.33.04

    +

    截屏2023-10-02 15.33.04

    测试过程与结果

    1. @@ -3130,7 +3130,7 @@

      测试过程与结果

      17 18 19
    % 读取数据
    -data = readmatrix('./Lab2/数据/111.csv');
    +data = readmatrix('./Lab2/数据/111.csv');
     
     % 获取vd和id列
     v1 = data(:, 2);
    @@ -3140,21 +3140,21 @@ 

    测试过程与结果

    plot(vd, id); %生成平滑曲线 -smoothed_vd = smooth(vd, 0.1, 'loess'); -smoothed_id = smooth(id, 0.1, 'loess'); +smoothed_vd = smooth(vd, 0.1, 'loess'); +smoothed_id = smooth(id, 0.1, 'loess'); hold on; -plot(smoothed_vd, smoothed_id, 'b-', 'LineWidth', 0.2); -legend('原始数据', '光滑曲线'); -xlabel('电压(V)'); -ylabel('电流(mA)'); -legend('实验数据','VA特性曲线'); +plot(smoothed_vd, smoothed_id, 'b-', 'LineWidth', 0.2); +legend('原始数据', '光滑曲线'); +xlabel('电压(V)'); +ylabel('电流(mA)'); +legend('实验数据','VA特性曲线');
    1. 将二极管更换为稳压二极管,重复上述步骤。

    结果分析

    整流二极管

    -

    +

    观察到以下几个特殊的地方:

    1. @@ -3166,14 +3166,14 @@

      整流二极管

    二极管方向恢复电流(Reverse Recovery Current) 在二极管由导通状态转变为截止状态时,电流反向流动的现象。当二极管从正向导通状态切换到反向截止状态时,载流子需要一定时间来清除。在这个短暂的时间内,二极管中的电流会反向流动,这就是方向恢复电流。方向恢复电流的大小和持续时间取决于二极管的特性和工作条件。

    稳压二极管

    -

    +

    可以观察到,稳压二极管的截止电压约为5.2V左右,与标称的5V/1W相匹配,同时可以观察到,稳压二极管相比于整流二极管,在两端电压增大的情况下,能保持一个较为稳定的电压值,约为0.76V左右。

    -
    +

    实验三:仿真⼆极管的VA特性

    实验方案

    利用Multisim平台搭建电路,利用扫描法绘制二极管曲线。

    Multisim平台一定需要一个接地端,同时示波器的接地端并不影响电路中的电位,因而实验电路如下:

    -

    +

    示波器A接口为二极管两端电压,B接口为R1两端电压。利用示波器的B/A按钮,定性地显示VA特性曲线,再利用Matlab处理输出的数据。

    测试过程与结果

      @@ -3201,14 +3201,14 @@

      1V,没有为负数的点,因而采用了指数的拟合方式15 16 17 -18
      data = readmatrix('./Lab2/数据/1V.csv');
      +18
      data = readmatrix('./Lab2/数据/1V.csv');
       vd = data(:, 1);
       vr = data(:, 2);
       id = vr * 0.1;
       
       % 使用fit函数进行数据拟合
      -fitType = fittype('a * exp(b * x)'); % 选择适当的拟合函数
      -fitOptions = fitoptions('Method', 'NonlinearLeastSquares'); % 选择拟合方法
      +fitType = fittype('a * exp(b * x)'); % 选择适当的拟合函数
      +fitOptions = fitoptions('Method', 'NonlinearLeastSquares'); % 选择拟合方法
       fitOptions.StartPoint = [1, -0.1]; % 初始拟合参数猜测
       
       % 进行数据拟合
      @@ -3216,9 +3216,9 @@ 

      1V,没有为负数的点,因而采用了指数的拟合方式 % 绘制拟合曲线 plot(fitResult,vd, id); -xlabel('电压(V)'); -ylabel('电流(mA)'); -legend('VA特性曲线'); +xlabel('电压(V)'); +ylabel('电流(mA)'); +legend('VA特性曲线');

      700V,由于数据点非常多,直接输出即位较光滑的曲线

      Matlab
       1
      @@ -3233,7 +3233,7 @@ 

      700V,由于数据点非常多,直接输出即位较光滑的 10 11 12

      % 读取数据
      -data = readmatrix('./Lab2/数据/700V_2.csv');
      +data = readmatrix('./Lab2/数据/700V_2.csv');
       
       % 获取vd和id列
       v1 = data(:, 1);
      @@ -3241,36 +3241,36 @@ 

      700V,由于数据点非常多,直接输出即位较光滑的 vd=v1; id=v2*0.1; plot(vd, id); -xlabel('电压(V)'); -ylabel('电流(mA)'); -legend('实验数据','VA特性曲线'); +xlabel('电压(V)'); +ylabel('电流(mA)'); +legend('实验数据','VA特性曲线');

      结果分析

      1V,主要分析二极管由导通到截止这一段的特点

      -

      +

      700V,主要分析1N4007截止电压的特性

      -

      +

      可以看出,由导通到截止这一部分,二极管的性质并不是非常稳定,所以曲线几乎填满了该段区域。

      探究性实验:信号源内部电阻

      引入

      -

      +

      观察上面的黄色曲线,会发现,当二极管导通后,峰值电压骤降。而分析可知,Channel1所测的是信号源两端电压,而电压骤降说明了信号源内部有电阻,进行分压,导致其峰值减小。现测量信号源两端的电阻大小。

      实验方案

      采用以下电路,利用欧姆定律对其进行测量。通过测量峰值电压的变化,得出信号源内部电阻大小

      -

      截屏2023-10-04 10.56.35

      +

      截屏2023-10-04 10.56.35

      测试过程与结果

      1. 将示波器接口两端与信号源两端连接。测出原本输出的电压幅值,\(V_{p1}=10.5V\)
      -

      +

      1. 连接方案中的电路图。
      -

      +

      1. 测出此时的电压峰值为,\(V_{p2}=5.23V\)
      -

      +

      1. 再次测量信号源两端电压,发现保持在10.5V,因此可以将信号源两端电压视为10.5V。
      @@ -3280,7 +3280,7 @@

      结果分析

      R_S=\dfrac{V_{p1}-V_{p2}}{I_R}=5.27V÷0.102A=51.7Ω \]

      计算得到,信号源内阻为51.7Ω,查阅说明书,得知Channel1输出的内阻在50Ω左右,因此可知测量基本准确。

      -

      信号源内部有50Ω左右的阻值,所以,以后在定量测量的时候,需要将内阻考虑在内,以免影响最后结果的准确性。

      +

      信号源内部有50Ω左右的阻值,所以,以后在定量测量的时候,需要将内阻考虑在内,以免影响最后结果的准确性。

      diff --git "a/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab3/Lab3 \346\225\260\345\255\227\347\224\265\350\267\257\351\200\273\350\276\221\350\256\276\350\256\241/index.html" "b/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab3/Lab3 \346\225\260\345\255\227\347\224\265\350\267\257\351\200\273\350\276\221\350\256\276\350\256\241/index.html" index 9c35e6da..f237d59e 100644 --- "a/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab3/Lab3 \346\225\260\345\255\227\347\224\265\350\267\257\351\200\273\350\276\221\350\256\276\350\256\241/index.html" +++ "b/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab3/Lab3 \346\225\260\345\255\227\347\224\265\350\267\257\351\200\273\350\276\221\350\256\276\350\256\241/index.html" @@ -2781,7 +2781,7 @@ -

      数字电路逻辑设计

      +

      数字电路逻辑设计

      实验日期:2023/10/9

      地点:东3-406

      实验目的

      @@ -2954,15 +2954,15 @@

      逻辑设计输入 task1.vhd

      tmp:=A&B&C;-- 将ABC的输入值连接 --case语句 根据不同情况输出不同的Z值 case tmp is - when "000" => Z<='1'; - when "001" => Z<='0'; - when "010" => Z<='1'; - when "011" => Z<='1'; - when "100" => Z<='1'; - when "101" => Z<='0'; - when "110" => Z<='1'; - when "111" => Z<='0'; - when others => Z<='0'; + when "000" => Z<='1'; + when "001" => Z<='0'; + when "010" => Z<='1'; + when "011" => Z<='1'; + when "100" => Z<='1'; + when "101" => Z<='0'; + when "110" => Z<='1'; + when "111" => Z<='0'; + when others => Z<='0'; end case; end process; --------------------------------- @@ -3034,29 +3034,29 @@

      逻辑设计仿真 test_tb.vhd

      U1: Task1 port map (A=>A,B=>B,C=>C,Z=>Z);--端口映射,将ABC的值输入到元件Task1中 P1: process begin -- 仿真 - A<='0';B<='0';C<='0';wait for 10ns; - A<='0';B<='0';C<='1';wait for 10ns; - A<='0';B<='1';C<='0';wait for 10ns; - A<='0';B<='1';C<='1';wait for 10ns; - A<='1';B<='0';C<='0';wait for 10ns; - A<='1';B<='0';C<='1';wait for 10ns; - A<='1';B<='1';C<='0';wait for 10ns; - A<='1';B<='1';C<='1';wait for 10ns; + A<='0';B<='0';C<='0';wait for 10ns; + A<='0';B<='0';C<='1';wait for 10ns; + A<='0';B<='1';C<='0';wait for 10ns; + A<='0';B<='1';C<='1';wait for 10ns; + A<='1';B<='0';C<='0';wait for 10ns; + A<='1';B<='0';C<='1';wait for 10ns; + A<='1';B<='1';C<='0';wait for 10ns; + A<='1';B<='1';C<='1';wait for 10ns; end process; end BEHAV;

      仿真结果

      -

      +

      根据波形图结果,可知,该元件的代码编写正确,可以进行下一操作。

      3. 生成编程文件

      1. 新建project
      -

      +

      1. 导入关于元件的文件task1.vhd
      -

      +

      1. 编译生成文件,并导入DE10芯片
      @@ -3066,7 +3066,7 @@

      3. 生成编程文件

    1. Fitter
    2. Assemble
    3. -

      +

      -

      +

      实验成果

      -

      +

      实验二:二进制全加器

      1. 分析真值表

      -

      image-20231016132054066

      +

      image-20231016132054066

      2. 仿真模拟

      逻辑设计输入 task2.vhd

      Vhdl
       1
      @@ -3131,15 +3131,15 @@ 

      逻辑设计输入 task2.vhd

      begin tmp:=A&B&C0; case tmp is -- case语句根据ABC0不同的值输出不同的C与Z - when "000" => C<='0';Z<='0'; - when "001" => C<='0';Z<='1'; - when "010" => C<='0';Z<='1'; - when "011" => C<='1';Z<='0'; - when "100" => C<='0';Z<='1'; - when "101" => C<='1';Z<='0'; - when "110" => C<='1';Z<='0'; - when "111" => C<='1';Z<='1'; - when others => C<='0';Z<='0'; + when "000" => C<='0';Z<='0'; + when "001" => C<='0';Z<='1'; + when "010" => C<='0';Z<='1'; + when "011" => C<='1';Z<='0'; + when "100" => C<='0';Z<='1'; + when "101" => C<='1';Z<='0'; + when "110" => C<='1';Z<='0'; + when "111" => C<='1';Z<='1'; + when others => C<='0';Z<='0'; end case; end process; end BEHAV ; @@ -3202,42 +3202,42 @@

      逻辑设计仿真 test_tb.vhd

      P1: process -----------主要的仿真部分------------------------------------------------- begin - A<='0';B<='0';C0<='0';wait for 10ns; - A<='0';B<='0';C0<='1';wait for 10ns; - A<='0';B<='1';C0<='0';wait for 10ns; - A<='0';B<='1';C0<='1';wait for 10ns; - A<='1';B<='0';C0<='0';wait for 10ns; - A<='1';B<='0';C0<='1';wait for 10ns; - A<='1';B<='1';C0<='0';wait for 10ns; - A<='1';B<='1';C0<='1';wait for 10ns; + A<='0';B<='0';C0<='0';wait for 10ns; + A<='0';B<='0';C0<='1';wait for 10ns; + A<='0';B<='1';C0<='0';wait for 10ns; + A<='0';B<='1';C0<='1';wait for 10ns; + A<='1';B<='0';C0<='0';wait for 10ns; + A<='1';B<='0';C0<='1';wait for 10ns; + A<='1';B<='1';C0<='0';wait for 10ns; + A<='1';B<='1';C0<='1';wait for 10ns; end process; end BEHAV;

      仿真结果

      -

      +

      与预期一致,所以可以进行下一步操作

      3. 生成编程文件

      1. -

        编译输出,得到以下逻辑图

        +

        编译输出,得到以下逻辑图

      2. pin planner

      -

      +

      实验成果

      -

      +

      上图对应A=0, B=0, C0=0的情况,输出C=0,Z=0的情况。

      -

      IMG_9548

      +

      IMG_9548

      上图对应A=0, B=1, C0=0的情况,输出C=0,Z=1的情况。

      -

      IMG_9549

      +

      IMG_9549

      上图对应A=1, B=1, C0=0的情况,输出C=1,Z=0的情况。

      -

      IMG_9550

      +

      IMG_9550

      上图对应A=1, B=1, C0=1的情况,输出C=1,Z=1的情况。

      实验三:开灯关灯的探究性实验  !注意:这个部分我写的些许有点错误,直接单数开关开则打开的思路即可

      1. 分析电路逻辑

      @@ -3301,12 +3301,12 @@

      设计元件 task3.vhd

      ---------关键部分:process----------------------------------- P1:process ---------定义变量 记录开关A,B,C,D,Z先前的状态---------------- -variable mA:std_logic:='0'; -variable mB:std_logic:='0'; -variable mC:std_logic:='0'; -variable mD:std_logic:='0'; -variable mZ:std_logic:='0'; -variable tmp:std_logic:='0'; +variable mA:std_logic:='0'; +variable mB:std_logic:='0'; +variable mC:std_logic:='0'; +variable mD:std_logic:='0'; +variable mZ:std_logic:='0'; +variable tmp:std_logic:='0'; begin if (mA /= A) then --如果A开关状态发生改变,下方各个结构同理 @@ -3378,21 +3378,21 @@

      仿真task3_tb.vhd

      ------------仿真过程------------------------------------------- P1: process begin - A<='0';B<='0';C<='0';D<='0';wait for 10ns; - A<='0';B<='0';C<='0';D<='1';wait for 10ns; - A<='1';B<='0';C<='0';D<='1';wait for 10ns; - A<='0';B<='0';C<='0';D<='1';wait for 10ns; + A<='0';B<='0';C<='0';D<='0';wait for 10ns; + A<='0';B<='0';C<='0';D<='1';wait for 10ns; + A<='1';B<='0';C<='0';D<='1';wait for 10ns; + A<='0';B<='0';C<='0';D<='1';wait for 10ns; end process; end BEHAV;

      仿真结果

      -

      +

      任意改变ABCD四个开关中任意状态,Z就会输出与原来相反的结果,仿真结果正确。

      3. 生成编程文件

      1. 编译输出
      -

      +

      1. Pin Planner

        @@ -3406,7 +3406,7 @@

        实验成果

        实验结果视频

        -

        结果分析,由于这个代码的问题,也就是在芯片最开始执行结构体部分的代码时,由于mA与A并不一定相匹配,所以刚刚开始,Z的灯可能混乱闪烁。但是一段时间后,也就是当所有mA,mB,mC,mD都已经与现实情况相匹配以后,就能够正常显示。

        +

        结果分析,由于这个代码的问题,也就是在芯片最开始执行结构体部分的代码时,由于mA与A并不一定相匹配,所以刚刚开始,Z的灯可能混乱闪烁。但是一段时间后,也就是当所有mA,mB,mC,mD都已经与现实情况相匹配以后,就能够正常显示。

        diff --git "a/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab4/lab4 \344\270\211\346\236\201\347\256\241\345\222\214\351\227\250\347\224\265\350\267\257\347\211\271\346\200\247\346\265\213\350\257\225/index.html" "b/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab4/lab4 \344\270\211\346\236\201\347\256\241\345\222\214\351\227\250\347\224\265\350\267\257\347\211\271\346\200\247\346\265\213\350\257\225/index.html" index 1f0a6fb6..091d676f 100644 --- "a/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab4/lab4 \344\270\211\346\236\201\347\256\241\345\222\214\351\227\250\347\224\265\350\267\257\347\211\271\346\200\247\346\265\213\350\257\225/index.html" +++ "b/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab4/lab4 \344\270\211\346\236\201\347\256\241\345\222\214\351\227\250\347\224\265\350\267\257\347\211\271\346\200\247\346\265\213\350\257\225/index.html" @@ -2872,7 +2872,7 @@

        Lab 4

        -

        三极管和门电路特性测试

        +

        三极管和门电路特性测试

        实验日期:2023/10/9

        地点:东3-406

        实验目的

        @@ -2899,13 +2899,13 @@

        一、判别三极管类型

        • 将三极管从右到左三只脚命名为a,b,c,利用万用表二极管测试级,测量三极管三只脚的极性。
        -

        截屏2023-10-22 15.53.51

        -

        +

        截屏2023-10-22 15.53.51

        +

        根据以上表格可以判断,该三极管中间的端口为b基极,且为NPN型三极管。

        • 接下来判断E和C极
        -

        IMG_9691

        +

        IMG_9691

        将万用表切换到HFE档,通过对三极管的放大倍数的测量,判断三极管的e和c极。已知正常的ß应该在100~300之间。

        将三极管中间的极脚插入b口,两端分别插入e和c。可见当示数显示为249时,e,b,c脚插入正确,放大倍数ß=249。从而可判断三极管的三只脚的极性:当平面对向自己时,从左到右三只脚分别为e,b,c。

        二、采用逐点法测量三极管输入VA特性

        @@ -2913,8 +2913,8 @@
        (1)固定V~CE~下,I~B~与V~BE~的关系
        1. 将电路连接为下图
        -

        image-20231022155558924

        -

        fig1 固定VCE下的实验电路图

        +

        image-20231022155558924

        +

        fig1 固定VCE下的实验电路图
        1. 调整V2的大小,即调整V~CE~的大小分别为0V和15V。调整直流输出源V1的大小,用万用表测量R1两端电压,从而得出V~BE~和I~B~的大小。

          @@ -2955,8 +2955,8 @@
          (1)固定V~CE~下,I~B~与V~BE~的关系
          30 31 32
        % 使用xlsread函数从Excel文件中读取数据
        -data1 = readtable('./1016all.xlsx', 'Sheet','0V','Range', 'C2:D17');
        -data2 = readtable('./1016all.xlsx', 'Sheet','15V', 'Range','C2:D19');
        +data1 = readtable('./1016all.xlsx', 'Sheet','0V','Range', 'C2:D17');
        +data2 = readtable('./1016all.xlsx', 'Sheet','15V', 'Range','C2:D19');
         
         % 提取电压和电流数据
         vbe1 = data1{:, 1};
        @@ -2965,79 +2965,79 @@ 
        (1)固定V~CE~下,I~B~与V~BE~的关系
        ib2 = data2{:,2}; % 绘制伏安特性曲线 -plot(vbe1, ib1, 'o'); % 绘制数据点和连接线 -title('固定VCE下三极管输出VA曲线'); % 添加标题 -xlabel('V_{BE}(V)'); % 添加x轴标签 -ylabel('I_B(uA)'); % 添加y轴标签 +plot(vbe1, ib1, 'o'); % 绘制数据点和连接线 +title('固定VCE下三极管输出VA曲线'); % 添加标题 +xlabel('V_{BE}(V)'); % 添加x轴标签 +ylabel('I_B(uA)'); % 添加y轴标签 grid on; % 添加网格线 % 对曲线进行平滑处理 -smoothed_ib1 = smooth(ib1, 5, 'loess'); +smoothed_ib1 = smooth(ib1, 5, 'loess'); hold on; % 在同一图中叠加平滑曲线 -plot(vbe1, smoothed_ib1, 'b-', 'LineWidth', 1); % 绘制平滑曲线 +plot(vbe1, smoothed_ib1, 'b-', 'LineWidth', 1); % 绘制平滑曲线 %绘制曲线2 hold on; -plot(vbe2, ib2, 'o'); % 绘制数据点和连接线 +plot(vbe2, ib2, 'o'); % 绘制数据点和连接线 grid on; % 添加网格线 % 对曲线进行平滑处理 -smoothed_ib2 = smooth(ib2, 5, 'loess'); % 使用rloess平滑算法 +smoothed_ib2 = smooth(ib2, 5, 'loess'); % 使用rloess平滑算法 hold on; % 在同一图中叠加平滑曲线 -plot(vbe2, smoothed_ib2, 'r-', 'LineWidth', 1); % 绘制平滑曲线 -legend('原始数据(0V)', '曲线(0V下)','原始数据(15V)', '曲线(15V下)'); +plot(vbe2, smoothed_ib2, 'r-', 'LineWidth', 1); % 绘制平滑曲线 +legend('原始数据(0V)', '曲线(0V下)','原始数据(15V)', '曲线(15V下)');
        实验结果与分析

        实验数据如下:

        -

        VCE=0V

        -

        截屏2023-10-22 16.51.12

        -

        VCE=15V下

        -

        截屏2023-10-22 16.49.53

        -

        -

        fig2 三极管VA特性曲线

        +

        VCE=0V
        +

        截屏2023-10-22 16.51.12

        +

        VCE=15V下
        +

        截屏2023-10-22 16.49.53

        +

        +

        fig2 三极管VA特性曲线
        (2)固定I~B~ 下,I~C~与V~CE~的关系
        1. 将电路图连接为下图
        -

        image-20231022165919379

        -

        fig3 固定Ib下的实验电路图

        +

        image-20231022165919379

        +

        fig3 固定Ib下的实验电路图
        1. 设定V1的大小,通过测量R1两端的电压,得出I~b~的电流大小,并在接下来的实验中不再改变V1,由于V2对I~b~的改变非常小,在此实验中忽略不计。
        2. 调节V2,测量R2两端电压,通过计算得出V~CE~和Ic的大小。
        3. 绘制伏安特性曲线。
        实验结果与分析
        -

        Ib=2.5uA

        -

        -

        Ib=5uA

        -

        截屏2023-10-22 17.07.30

        -

        Ib=7.5uA

        -

        截屏2023-10-22 17.07.42

        -

        Ib=10uA

        -

        截屏2023-10-22 17.07.20

        -

        -

        fig4 绘制VA特性曲线

        +

        Ib=2.5uA
        +

        +

        Ib=5uA
        +

        截屏2023-10-22 17.07.30

        +

        Ib=7.5uA
        +

        截屏2023-10-22 17.07.42

        +

        Ib=10uA
        +

        截屏2023-10-22 17.07.20

        +

        +

        fig4 绘制VA特性曲线
        一些特殊点的分析
        -

        -

        fig5 I_b=2.5uA下的VA曲线

        +

        +

        fig5 I_b=2.5uA下的VA曲线

        我们发现,当I~b~=2.5uA时ce的压降使得Ic到达饱和区时,放大电流随着压降增大而减小。

        -

        -

        fig6 I=10uA下的VA曲线

        +

        +

        fig6 I=10uA下的VA曲线

        而当I~b~=10uA时,放大电流随着V~CE~增加增大。这种现象,可能也恰好反映了基极电流会随着CE两端电压的大小变化而发生变化,但是所造成的变化并不明显,所以上述实验可以通过保持V1不变控制I~b~不变。

        实验二:采用MULTISIM逐点仿真三极管输入VA特性

        仿真过程

        1. 利用MULTISIM软件搭建以下电路:
        -

        -

        fig7 控制VCE不变下的实验电路

        -

        -

        fig8 控制Ib不变下的实验电路

        +

        +

        fig7 控制VCE不变下的实验电路
        +

        +

        fig8 控制Ib不变下的实验电路
        1. 利用软件自带的仿真功能仿真->直流扫描功能,改变所要调节的参数,获得所要的特性曲线。
        -

        -

        fig9 固定Vce=15V,改变V1的值,获得的扫描曲线

        +

        +

        fig9 固定Vce=15V,改变V1的值,获得的扫描曲线
        1. 利用matlab进行数据处理,获得最终值。
        @@ -3063,32 +3063,32 @@

        仿真过程

        19 20 21 -22
        data1 = readmatrix('./1016/1_0V.csv','NumHeaderLines',1);
        +22
        data1 = readmatrix('./1016/1_0V.csv','NumHeaderLines',1);
         % 提取电压和电流数据
         vbe1 = data1(:, 5);
         ib1 = data1(:, 2);
         
         % 对曲线进行平滑处理
        -smoothed_ib1 = smooth(ib1, 5, 'loess'); 
        -plot(vbe1, smoothed_ib1, 'b-', 'LineWidth', 1); % 绘制平滑曲线
        -title('固定VCE下三极管输出VA曲线'); % 添加标题
        -xlabel('V_{BE}(V)'); % 添加x轴标签
        -ylabel('I_B(uA)'); % 添加y轴标签
        +smoothed_ib1 = smooth(ib1, 5, 'loess'); 
        +plot(vbe1, smoothed_ib1, 'b-', 'LineWidth', 1); % 绘制平滑曲线
        +title('固定VCE下三极管输出VA曲线'); % 添加标题
        +xlabel('V_{BE}(V)'); % 添加x轴标签
        +ylabel('I_B(uA)'); % 添加y轴标签
         grid on; % 添加网格线
         
        -data2 = readmatrix('./1016/2_15V.csv','NumHeaderLines',1);
        +data2 = readmatrix('./1016/2_15V.csv','NumHeaderLines',1);
         % 提取电压和电流数据
         vbe2 = data2(:,5);
         ib2 = data2(:,2);
         % 对曲线进行平滑处理
        -smoothed_ib2 = smooth(ib2, 5, 'loess'); % 使用rloess平滑算法
        +smoothed_ib2 = smooth(ib2, 5, 'loess'); % 使用rloess平滑算法
         hold on; % 在同一图中叠加平滑曲线
        -plot(vbe2, smoothed_ib2, 'r-', 'LineWidth', 1); % 绘制平滑曲线
        -legend('V_{CE}=0V','V_{CE}=15V');
        +plot(vbe2, smoothed_ib2, 'r-', 'LineWidth', 1); % 绘制平滑曲线
        +legend('V_{CE}=0V','V_{CE}=15V');
         

        实验结果

        -

        -

        +

        +

        实验三:测试与非门逻辑功能

        实验器材

          @@ -3100,14 +3100,14 @@

          测试过程与结果

          1. 连接电路为下图,注意7脚接地和14脚接高电平
          -

          -

          fig10 连接电路

          +

          +

          fig10 连接电路
          1. 点按按钮,改变输入两端电压。
          2. 利用万用表测量引脚电压。

          实验结果

          -

          +

          实验四:与非门传输特性测量

          实验器材

            @@ -3122,8 +3122,8 @@

            (1)逐点输入直流电压,测量其传输特性。

            1. 连接电路
            -

            image-20231022204950152

            -

            fig11 测试电路

            +

            image-20231022204950152

            +

            fig11 测试电路
            1. 调节2脚的电位,使用万用表测量2脚以及输出端电压。

              @@ -3132,14 +3132,14 @@

              (1)逐点输入直流电压,测量其传输特性。

              记录数据,并根据数据绘制图线。

            -

            截屏2023-10-22 20.57.37

            -

            +

            截屏2023-10-22 20.57.37

            +

            (2)输入0至5V变化的电压,利用扫描法测量传输特性

            1. 连接电路。
            -

            image-20231022211723785

            -

            fig12 测试电路

            +

            image-20231022211723785

            +

            fig12 测试电路
            1. 调节信号源为0V~5V锯齿波,对称性为50%,频率为10Hz。

              @@ -3148,11 +3148,11 @@

              (2)输入0至5V变化的电压,利用扫描法测量传输

              调节示波器至显示清晰稳定图像。

            -

            +

            1. 切换观察选项为XY显示。
            -

            +

            结果分析

            • @@ -3173,11 +3173,11 @@

              测试过程与结果

              1. 连接电路
              -

              image-20231022212159202

              +

              image-20231022212159202

              1. 利用万用表测量电压,并记录数据
              -

              +

              结果分析

              • 当2脚接低点位时,与非门内部的电压高于外界电压,导致有电流通过。
              • @@ -3194,8 +3194,8 @@

                测试过程与结果

                1. 连接电路
                -

                image-20231022213340242

                -

                输出高电平                                        输出低电平

                +

                image-20231022213340242

                +

                输出高电平                                        输出低电平

                200Ω作为保护电阻,保护电路

                1. @@ -3209,10 +3209,10 @@

                  测试过程与结果

                实验结果与分析

                -

                -

                image-20231022220805720

                +

                +

                image-20231022220805720

                可以看到与非门输出在外端串联电阻时,尤其是小电阻,输出并不是标准的高电平或者低电平。与非门内部呈现一定的定值电阻特性(由两段曲线呈现直线可以看出)。经过一定的计算,可以得出与非门内部的电阻可以近似估计为0.02Ω。

                -

                +

                diff --git "a/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab5/Lab5 \345\260\217\350\275\246\346\243\200\346\265\213\347\224\265\350\267\257\345\222\214\347\224\265\346\234\272\351\251\261\345\212\250\347\224\265\350\267\257\346\265\213\350\257\225/index.html" "b/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab5/Lab5 \345\260\217\350\275\246\346\243\200\346\265\213\347\224\265\350\267\257\345\222\214\347\224\265\346\234\272\351\251\261\345\212\250\347\224\265\350\267\257\346\265\213\350\257\225/index.html" index 6eb58189..ffa7161c 100644 --- "a/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab5/Lab5 \345\260\217\350\275\246\346\243\200\346\265\213\347\224\265\350\267\257\345\222\214\347\224\265\346\234\272\351\251\261\345\212\250\347\224\265\350\267\257\346\265\213\350\257\225/index.html" +++ "b/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab5/Lab5 \345\260\217\350\275\246\346\243\200\346\265\213\347\224\265\350\267\257\345\222\214\347\224\265\346\234\272\351\251\261\345\212\250\347\224\265\350\267\257\346\265\213\350\257\225/index.html" @@ -2700,7 +2700,7 @@ -

                小车检测电路和电机驱动电路测试

                +

                小车检测电路和电机驱动电路测试

                实验日期:2023/10/23

                地点:东3-406

                实验目的

                @@ -2732,8 +2732,8 @@

                测试过程与结果

                1. 分析电路
                -

                -

                fig1 OPTO5内部电路

                +

                +

                fig1 OPTO5内部电路

                我们主要讨论R17的阻值,R19的阻值和W5为什么为大电阻(10k)。

                1. @@ -2799,8 +2799,8 @@

                  测试过程与结果

                  U_{LED}=V_{I}-U_{R_{19}}=3.329-1.253=2.076V \end{array} $$

                  -

                  -

                  fig2 发光二极管I-V特性曲线

                  +

                  +

                  fig2 发光二极管I-V特性曲线

                  根据上述图表,同时根据我们的二极管为绿色二极管可知,当选用3.3V的发光二极管时,已经能够较好地体现发光特性,电流以毫安级别通过。

                  R20作为并联电阻,搜索资料得知,在LED两端并联大电阻,当有反向电流流过时,能稳定LED两端电压,避免所有分压在一个LED灯上,导致LED灯反向击穿;同时,能够很好的释放LED内部存储的能量,使得LED灯快速熄灭。

                2. @@ -2877,22 +2877,22 @@

                  测试过程与结果

                  测量LED06阻值两端的电压与LED05所得结果基本相似。

                  【1.2 不同表面,光电管反射电压测量】
                  【1.3 区分黑白地面的比较电压值】
                  -

                  截屏2023-10-29 13.51.21

                  +

                  截屏2023-10-29 13.51.21

                  根据实验结果,可以得到以下结论:反射表面对红外线吸收能力越强,光电管反射电压越高。

                  随着反射表面对红外线能力的吸收增强,光电管两端电压增加,当超过另外一只引脚的输入电压后,比较器输出相反的性质。

                  1. 将红外探测仪置于白色表面不同高度处(通过小车下面垫置书本实现),测量光电管反射电压。
                  【1.4不同高度(2至6CM),光电管反射电压测量比较】
                  -

                  截屏2023-10-29 13.52.21

                  -

                  截屏2023-10-29 13.25.50

                  +

                  截屏2023-10-29 13.52.21

                  +

                  截屏2023-10-29 13.25.50

                  • 当光电管离地越来越高,所能吸收的红外光线越来越少,两端电压越来越大。
                  • 当光电管高度大约为3.5~3.7cm左右时,光电管两端电压逐渐靠近1.992V(另一只脚的电压),此时从比较器从输出低电压转变为高电压,在这个电压值以下,指示LED灯发光,以上则熄灭。
                  • 在实际使用中,为了避免高度对测量结果的影响,当一只脚的引脚为2V左右,应该将光电管置于<2.5cm的位置。当然,也要根据具体的另一只脚的电位,具体调整光电管离地高度。
                  【1.5 观察环境光亮对光电检测电路的影响】
                  -

                  截屏2023-10-29 13.34.58

                  +

                  截屏2023-10-29 13.34.58

                  • 可见,环境对实验有一定的影响,当其影响在1%左右,所以可以忽略不计。
                  • 在昏暗环境下,去除了日光中的红外线对光电管的影响,从而使得其引脚11两端电压略微升高
                  • @@ -2907,8 +2907,8 @@

                    测试过程与结果

                  • 调节直流稳压源的电压,记录万用表读数
                  • 交换输入电压源正负极,测量电机反转时的VA特性。
                -

                截屏2023-10-29 13.54.32

                -

                +

                截屏2023-10-29 13.54.32

                +

                • 直流电压源从高到低变化时,电流逐渐较小,同时也可以观察到,电动机的转速慢慢减小。
                • 当电压源电压过小时,电动机停转,同时电流急剧上升,此时不再对外输出机械能,而是等效为一个电阻,只输出热能。
                • @@ -2920,8 +2920,8 @@

                  测试过程与结果

                  1. 分析PCB板上的电路图。
                  -

                  截屏2023-10-29 18.46.29

                  -

                  fig3 电机控制电路电路图

                  +

                  截屏2023-10-29 18.46.29

                  +

                  fig3 电机控制电路电路图

                  该电路分为三个模块:

                  • 光电控制电路
                  • @@ -2939,13 +2939,13 @@

                    测试过程与结果

                    1. 将电板接入电源,根据引脚图连接电路
                    -

                    截屏2023-10-29 19.19.00

                    -

                    fig4 引脚输入图

                    +

                    截屏2023-10-29 19.19.00

                    +

                    fig4 引脚输入图

                    将输入脚ENA总控制开关,IN1、IN2等输入引脚与3.3V或者GND脚连接,以控制输入电位的高低。

                    1. 利用万用表测量各电位电压,记录数据。
                    -

                    +

                    • 输入IN1,IN2,输入端的高电压对应了OUT1和OUT2的高电压。
                    • 当输出端OUT1、OUT2对应的电压有一定的电压差时,电机转动。
                    • @@ -2959,12 +2959,12 @@

                      测试过程与结果

                    • ENA输入高电压。调节IN1、IN2、IN3、IN4的输入逻辑以控制电机正反转。
                    • 观察小车的运转情况。
          -

          截屏2023-10-29 20.02.13

          +

          截屏2023-10-29 20.02.13

          • 当两端均正转后,由于两端的电机并不一定完全一致,所以在实际情况中,两电机均正转时,并不如设想一般直走,而是有微微的偏移,在我们实验过程中,小车微微左转,可见左边电机的转速略微慢于右边。在后续编程小车的时候,需要对电路进行一定的改进,使得输出电压能够使小车正走。
          • 左右电机一正一反时,小车绕两轮线段的中心旋转。
          • 左右电机中一个为正,一个停转时,这基本上绕停转的轮转。
          • -
          + diff --git "a/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab6/Lab6 \346\231\272\350\203\275\345\260\217\350\275\246\346\216\247\345\210\266/index.html" "b/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab6/Lab6 \346\231\272\350\203\275\345\260\217\350\275\246\346\216\247\345\210\266/index.html" index 273af9e9..e26e2b30 100644 --- "a/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab6/Lab6 \346\231\272\350\203\275\345\260\217\350\275\246\346\216\247\345\210\266/index.html" +++ "b/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/Lab6/Lab6 \346\231\272\350\203\275\345\260\217\350\275\246\346\216\247\345\210\266/index.html" @@ -2571,7 +2571,7 @@ -

          智能小车控制

          +

          智能小车控制

          实验日期:2023/10/30

          地点:东3-406

          实验目的

          @@ -2602,8 +2602,8 @@

          测试过程与结果

          轨道经测量,约为两指宽。所以,选择中间两盏小灯作为沿轨道行进判定,和间隔一个旁边的小灯作为转弯判定。

        -

        截屏2023-11-01 19.48.09

        -

        fig1 光电管示意图(蓝色为选择的光电管)

        +

        截屏2023-11-01 19.48.09

        +

        fig1 光电管示意图(蓝色为选择的光电管)
        • 分析输出端口电位

          @@ -2614,8 +2614,8 @@

          测试过程与结果

        根据第一步的分析,我们需要一个以下有5个接口,7个输出口的逻辑芯片。

        -

        截屏2023-11-01 21.03.41

        -

        fig2 设计逻辑示意图

        +

        截屏2023-11-01 21.03.41

        +

        fig2 设计逻辑示意图
        • 开关设计,利用FPGA板上的开关键Switch0,来控制实体的运作与否。

          @@ -2633,14 +2633,14 @@

          测试过程与结果

          6 7 8 -9
          if (swt='1') then
          -  swto<='1';
          -  ena<='1';
          -  enb<='1';
          +9
          if (swt='1') then
          +  swto<='1';
          +  ena<='1';
          +  enb<='1';
           else
          -  swto<='0';
          -  ena<='0';
          -  enb<='0';
          +  swto<='0';
          +  ena<='0';
          +  enb<='0';
           end if;
           
            @@ -2656,16 +2656,16 @@

            测试过程与结果

          当左轮转动时,in1输出1,in2输出0

          当左轮转动时,in3输出1,in4输出0

          -

          截屏2023-11-01 21.46.32

          +

          截屏2023-11-01 21.46.32

        Vhdl
        1
         2
         3
         4
        -------------直行循轨-------------------------------
        -when "0110"=> in1<='1';in2<='0';in3<='1';in4<='0';
        -when "0010"=> in1<='1';in2<='0';in3<='0';in4<='0';
        -when "0100"=> in1<='0';in2<='0';in3<='1';in4<='0';
        +when "0110"=> in1<='1';in2<='0';in3<='1';in4<='0';
        +when "0010"=> in1<='1';in2<='0';in3<='0';in4<='0';
        +when "0100"=> in1<='0';in2<='0';in3<='1';in4<='0';
         
        • @@ -2673,11 +2673,11 @@

          测试过程与结果

          • 主要岔路判断过程,小车在行进过程中,最旁边的灯判断了在左/右遇到岔路的情况
          -

          截屏2023-11-01 21.57.16

          +

          截屏2023-11-01 21.57.16

          • 如果在遇到岔路过程中,中间的两盏灯出现了一亮一灭的情况,具体如下图(左边遇到岔路的情况,右边遇到岔路同理)所示,则应该一定地修正轨迹。
          -

          +

        Vhdl
        1
        @@ -2688,18 +2688,18 @@ 

        测试过程与结果

        6 7 8
        -------------岔路判断-------------------------------
        -when "0111"=> in1<='1';in2<='0';in3<='1';in4<='0';
        -when "0011"=> in1<='1';in2<='0';in3<='0';in4<='0';
        -when "0101"=> in1<='0';in2<='0';in3<='1';in4<='0';
        +when "0111"=> in1<='1';in2<='0';in3<='1';in4<='0';
        +when "0011"=> in1<='1';in2<='0';in3<='0';in4<='0';
        +when "0101"=> in1<='0';in2<='0';in3<='1';in4<='0';
         
        -when "1110"=> in1<='1';in2<='0';in3<='1';in4<='0';
        -when "1010"=> in1<='1';in2<='0';in3<='0';in4<='0';
        -when "1100"=> in1<='0';in2<='0';in3<='1';in4<='0';
        +when "1110"=> in1<='1';in2<='0';in3<='1';in4<='0';
        +when "1010"=> in1<='1';in2<='0';in3<='0';in4<='0';
        +when "1100"=> in1<='0';in2<='0';in3<='1';in4<='0';
         
        • 小车直角转弯

          -

          截屏2023-11-05 18.48.32

          +

          截屏2023-11-05 18.48.32

          当小车回到轨道后,由于光电管并不一定稳定运行,所以利用之前的发光判断,小车会自行沿着轨道左转或者右转。

        • @@ -2708,8 +2708,8 @@

          测试过程与结果

        Vhdl
        1
        -2
        when "0000"=> in1<='0';in2<='0';in3<='0';in4<='0';
        -when "1111"=> in1<='0';in2<='1';in3<='0';in4<='1';
        +2
        when "0000"=> in1<='0';in2<='0';in3<='0';in4<='0';
        +when "1111"=> in1<='0';in2<='1';in3<='0';in4<='1';
         

        全代码

        Vhdl
         1
        @@ -2793,41 +2793,41 @@ 

        全代码

        begin tmp:=ledp1&ledc1&ledc2&ledp2; case tmp is -when "0000"=> in1<='0';in2<='0';in3<='0';in4<='0'; -when "1111"=> in1<='0';in2<='1';in3<='0';in4<='1'; +when "0000"=> in1<='0';in2<='0';in3<='0';in4<='0'; +when "1111"=> in1<='0';in2<='1';in3<='0';in4<='1'; -when "0110"=> in1<='1';in2<='0';in3<='1';in4<='0'; -when "0010"=> in1<='1';in2<='0';in3<='0';in4<='0'; -when "0100"=> in1<='0';in2<='0';in3<='1';in4<='0'; +when "0110"=> in1<='1';in2<='0';in3<='1';in4<='0'; +when "0010"=> in1<='1';in2<='0';in3<='0';in4<='0'; +when "0100"=> in1<='0';in2<='0';in3<='1';in4<='0'; -when "0111"=> in1<='1';in2<='0';in3<='1';in4<='0'; -when "0011"=> in1<='1';in2<='0';in3<='0';in4<='0'; -when "0101"=> in1<='0';in2<='0';in3<='1';in4<='0'; +when "0111"=> in1<='1';in2<='0';in3<='1';in4<='0'; +when "0011"=> in1<='1';in2<='0';in3<='0';in4<='0'; +when "0101"=> in1<='0';in2<='0';in3<='1';in4<='0'; -when "1110"=> in1<='1';in2<='0';in3<='1';in4<='0'; -when "1010"=> in1<='1';in2<='0';in3<='0';in4<='0'; -when "1100"=> in1<='0';in2<='0';in3<='1';in4<='0'; +when "1110"=> in1<='1';in2<='0';in3<='1';in4<='0'; +when "1010"=> in1<='1';in2<='0';in3<='0';in4<='0'; +when "1100"=> in1<='0';in2<='0';in3<='1';in4<='0'; -when "1000"=> in1<='0';in2<='0';in3<='1';in4<='0'; -when "1001"=> in1<='0';in2<='0';in3<='0';in4<='0'; -when "0001"=> in1<='1';in2<='0';in3<='0';in4<='0'; -when "1101"=> in1<='0';in2<='0';in3<='0';in4<='0'; -when "1011"=> in1<='0';in2<='0';in3<='0';in4<='0'; -when others =>in1<='X';in2<='X';in3<='X';in4<='X'; +when "1000"=> in1<='0';in2<='0';in3<='1';in4<='0'; +when "1001"=> in1<='0';in2<='0';in3<='0';in4<='0'; +when "0001"=> in1<='1';in2<='0';in3<='0';in4<='0'; +when "1101"=> in1<='0';in2<='0';in3<='0';in4<='0'; +when "1011"=> in1<='0';in2<='0';in3<='0';in4<='0'; +when others =>in1<='X';in2<='X';in3<='X';in4<='X'; end case; end process; P2: process(swt) begin -if (swt='1') then -swto<='1'; -ena<='1'; -enb<='1'; +if (swt='1') then +swto<='1'; +ena<='1'; +enb<='1'; else -swto<='0'; -ena<='0'; -enb<='0'; +swto<='0'; +ena<='0'; +enb<='0'; end if; end process; end runner; @@ -2835,10 +2835,10 @@

        全代码

        1. 连接各功能芯片模块。
        -

        截屏2023-11-01 21.03.41

        +

        截屏2023-11-01 21.03.41

        根据以上示意图,先物理上连接各引脚的输入输出。

        后在Quartus软件上,对FPGA进行pin planner

        -

        000000

        +

        000000

        在Quartars中编译文件,成功运行并导入FPGA板中。

        1. 连入电源,测试小车。
        2. @@ -2848,15 +2848,15 @@

          测试结果

        3. 直角转弯时非常困难的一部分,我们发现,小车有概率地在直角转弯处停下,后观察光电管情况,发现,一些时候,tmp可能出现“0001”或者“1000”的情况,即最旁边的引脚在轨道内,而其他光电管偏离轨道。于是,对程序进行修改,
        Vhdl
        1
        -2
        when "1000"=> in1<='0';in2<='0';in3<='1';in4<='0';
        -when "0001"=> in1<='1';in2<='0';in3<='0';in4<='0';
        +2
        when "1000"=> in1<='0';in2<='0';in3<='1';in4<='0';
        +when "0001"=> in1<='1';in2<='0';in3<='0';in4<='0';
         

        修改后,小车能够顺利转弯。

        1. 小车能依照轨道进行运动。

        结果分析

        -

        即要从逻辑上分析小车运动的情况,也要根据实验中具体出现的问题进行调整。这也说明,在未来的实验中,不光光要从理论上严谨分析,也要从具体实际中实践,修改,然后完善。

        +

        即要从逻辑上分析小车运动的情况,也要根据实验中具体出现的问题进行调整。这也说明,在未来的实验中,不光光要从理论上严谨分析,也要从具体实际中实践,修改,然后完善。

        diff --git "a/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/WLab1/WLab1/index.html" "b/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/WLab1/WLab1/index.html" index 3d474b60..3bfc4d57 100644 --- "a/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/WLab1/WLab1/index.html" +++ "b/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/WLab1/WLab1/index.html" @@ -2467,7 +2467,7 @@

        WLab 1

        - +

        diff --git "a/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/lab7/index.html" "b/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/lab7/index.html" index 990483ab..968c5fb5 100644 --- "a/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/lab7/index.html" +++ "b/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/lab7/index.html" @@ -2472,7 +2472,7 @@ -

        参考代码

        +

        参考代码

        以下代码有些许语法错误

        Vhdl
         1
          2
        @@ -2526,17 +2526,17 @@ 

        参考代码

        p1:process (Freq_in,Clr_n) variable cnt_val: natural range 0 to 49999999; begin - if(Clr_n='0')then + if(Clr_n='0')then cnt_val:=0; - elsif(Freq_in'event and Freq_in='1')then + elsif(Freq_in'event and Freq_in='1')then if(cnt_val=Div_num)then cnt_val:=0; elsif(cnt_val<Div_num/2)then cnt_val:=cnt_val+1; - Freq_out<='0'; + Freq_out<='0'; else cnt_val:=cnt_val+1; - Freq_out<='1'; + Freq_out<='1'; end if; end if; end process; @@ -2585,9 +2585,9 @@

        参考代码

        begin P1:process(Clk,Clr_n) begin - if(Clr_n='0')then - Q_tmp<="0000"; - elsif(Clk'event and Clk='1')then + if(Clr_n='0')then + Q_tmp<="0000"; + elsif(Clk'event and Clk='1')then Q_tmp<=Q_tmp+1; end if; end process; @@ -2633,9 +2633,9 @@

        参考代码

        process(A,B) begin if(A>B)then - AGB<='1'; + AGB<='1'; else - AGB<='0'; + AGB<='0'; end if; end proscess; end BEHAV; @@ -2711,11 +2711,11 @@

        参考代码

        signal Freq_out:std_logic; signal cnt_out:std_logic_vector (3 downto 0); begin - ul:DIVX port map (Freq_in=>Freq_in, Clr_n=>'1', Div_num=>26315, Freq_out=>Freq_out); - u2:CNT16 port map (Clk=>Freq_out, Clr_n=>'1', Q=>cnt_out); + ul:DIVX port map (Freq_in=>Freq_in, Clr_n=>'1', Div_num=>26315, Freq_out=>Freq_out); + u2:CNT16 port map (Clk=>Freq_out, Clr_n=>'1', Q=>cnt_out); u3:CMP4BIT port map (A=>cnt_out, B=>swtch, AGB=>PWM) end Behavioral; -
        +
        diff --git "a/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/preview/index.html" "b/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/preview/index.html" index 0a555af8..5482045c 100644 --- "a/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/preview/index.html" +++ "b/site/JY_FENG/1 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257I\345\256\236\351\252\214/preview/index.html" @@ -1679,6 +1679,30 @@ + +
      2. @@ -2509,8 +2533,20 @@

        Preview

        -

        写在前面 for 电路与电子技术实验I

        -

        电院实验课本身内容并不复杂,具体操作老师基本上会给出,但是完成实验并得到效果还是一个比较繁琐的内容,再加上对实验报告有一定的要求,

        +

        写在前面 for 电路与电子技术实验I

        +

        电院实验课本身内容并不复杂,具体操作老师基本上会给出,但是完成实验并得到效果还是一个比较繁琐的内容,再加上对实验报告有一定的要求,所以会觉得这2学分的课实在是性价比过高。

        +

        综合实验报告成绩和两次考核成绩,本人最终成绩为94,所以可以以此为基准参考需要的努力程度。

        +

        综合一年的实验感受,实验报告总的完成以下两点要求差不多就可以拿到一个不错的成绩:

        +
          +
        • 实验内容不缺不漏
        • +
        • 实验结果准确无误,和理论基本一致
        • +
        +

        学习内容

        +

        秋学期:综合实验,各类内容均有涉及,主要目的是了解实验器材,然后对”电“有一定的概念。祁才军老师负责,但应该教完我们这一届就退休了。期末考试内容涉及PPT内容较多,认真阅读PPT,对期末考试有较大帮助。

        +

        冬学期:电路原理部分实验。实际上涉及较多模电实验的内容。姚缨英老师主要负责。姚老师虽然看上去事情很多,实际上事情也是真的多。PPT上的实验内容也比较杂乱,但可以根据往届的实验报告推测老师的实验要求。同时有任何不理解的内容和要求,也建议主动问姚老师。姚老师会非常耐心地解答。

        +

        考试

        +

        秋学期:期末考试以笔试形式考察秋学期的所有实验内容,认真阅读PPT

        +

        冬学期:姚老师基本上会以各种方式提示期末考试的内容

        diff --git "a/site/JY_FENG/2 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257II\345\256\236\351\252\214/Lab5/Lab5/index.html" "b/site/JY_FENG/2 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257II\345\256\236\351\252\214/Lab5/Lab5/index.html" index 8713ab53..994de116 100644 --- "a/site/JY_FENG/2 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257II\345\256\236\351\252\214/Lab5/Lab5/index.html" +++ "b/site/JY_FENG/2 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257II\345\256\236\351\252\214/Lab5/Lab5/index.html" @@ -2467,8 +2467,8 @@

        Lab 5 仪用放大电路及其应用实验

        -

        仿真所用文件在这里: Lab5 PSpice仿真.zip

        - +

        仿真所用文件在这里: Lab5 PSpice仿真.zip

        +
        diff --git "a/site/JY_FENG/2 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257II\345\256\236\351\252\214/Lab6/Lab6/index.html" "b/site/JY_FENG/2 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257II\345\256\236\351\252\214/Lab6/Lab6/index.html" index 435c6f2d..ff5521c7 100644 --- "a/site/JY_FENG/2 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257II\345\256\236\351\252\214/Lab6/Lab6/index.html" +++ "b/site/JY_FENG/2 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257II\345\256\236\351\252\214/Lab6/Lab6/index.html" @@ -2467,8 +2467,8 @@

        Lab 6 滤波器的设计与实现

        -

        Lab6所使用仿真软件 Lab6 PSpice仿真.zip

        - +

        Lab6所使用仿真软件 Lab6 PSpice仿真.zip

        +
        diff --git "a/site/JY_FENG/2 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257II\345\256\236\351\252\214/Lab7/Lab7/index.html" "b/site/JY_FENG/2 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257II\345\256\236\351\252\214/Lab7/Lab7/index.html" index 2f65f02e..e2bf05e8 100644 --- "a/site/JY_FENG/2 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257II\345\256\236\351\252\214/Lab7/Lab7/index.html" +++ "b/site/JY_FENG/2 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257II\345\256\236\351\252\214/Lab7/Lab7/index.html" @@ -2467,8 +2467,8 @@

        Lab 7 扩音机电路的设计制作与测试

        -

        Lab7中所使用的仿真文件: Lab7PSpice仿真.zip

        - +

        Lab7中所使用的仿真文件: Lab7PSpice仿真.zip

        +
        diff --git "a/site/JY_FENG/2 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257II\345\256\236\351\252\214/Lab9/Lab9/index.html" "b/site/JY_FENG/2 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257II\345\256\236\351\252\214/Lab9/Lab9/index.html" index 3232af49..f82e980e 100644 --- "a/site/JY_FENG/2 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257II\345\256\236\351\252\214/Lab9/Lab9/index.html" +++ "b/site/JY_FENG/2 \347\224\265\350\267\257\347\224\265\345\255\220\346\212\200\346\234\257II\345\256\236\351\252\214/Lab9/Lab9/index.html" @@ -2467,8 +2467,8 @@

        Lab 9 全加器与奇偶位检验电路

        -

        Lab9中所使用的Multisim仿真文件: Lab9 Multisim.zip

        - +

        Lab9中所使用的Multisim仿真文件: Lab9 Multisim.zip

        +
        diff --git "a/site/JY_FENG/3 \347\224\265\347\275\221\347\273\234\345\210\206\346\236\220/Preview/index.html" "b/site/JY_FENG/3 \347\224\265\347\275\221\347\273\234\345\210\206\346\236\220/Preview/index.html" new file mode 100644 index 00000000..e14bd40b --- /dev/null +++ "b/site/JY_FENG/3 \347\224\265\347\275\221\347\273\234\345\210\206\346\236\220/Preview/index.html" @@ -0,0 +1,2584 @@ + + + + + + + + + + + + + + + + + + + + + 写在前面 for 电网络分析 - JY-HF learning site + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + + + 跳转至 + + +
        +
        + +
        + + + + +
        + + +
        + +
        + + + + + + + + + +
        +
        + + + +
        +
        +
        + + + + + + + + + +
        +
        +
        + + + + +
        +
        + + + + + + + +

        写在前面 for 电网络分析

        + + + + + + + + + + + + + + + + + + + + + + +
        +
        + + + +
        + + + +
        + + + +
        +
        +
        +
        + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/site/JY_FENG/JY-Feng/index.html b/site/JY_FENG/JY-Feng/index.html index 355d3913..3803db6e 100644 --- a/site/JY_FENG/JY-Feng/index.html +++ b/site/JY_FENG/JY-Feng/index.html @@ -2467,10 +2467,27 @@

        Preview

        -
        Python
        1
        -2
        import sys
        -print(sys.exeutation)
        -
        +

        编写者为ZJU 22级电子信息工程专业学生,由于加入爱迪生班,所以内容主要面向爱迪生班专业内容(爱迪生班内容会在后面标注\(\alpha\))。

        +

        这里作为我对本专业的回顾,以及一些经验~

        +

        专业课大致内容如下:(打勾内容为已更新)

        +
          +
        • 电路与电子技术I与II实验(\(\alpha\)) 实验报告 ✓
        • +
        • 电网络分析(\(\alpha\)) 课程内容与拓展
        • +
        • 电路与电子技术I与II(\(\alpha\))一些笔记和经验之谈
        • +
        • 工程电磁场与波
        • +
        • 微机原理及应用(\(\alpha\))
        • +
        • 微机原理及应用综合实验(\(\alpha\))
        • +
        • 信号分析与处理实验(\(\alpha\)),【为什么没有理论课?因为我恨傅里叶】
        • +
        • ......
        • +
        +

        各类通识课:

        +
          +
        • 微观经济学原理
        • +
        • 概率论及数理统计
        • +
        • 微积分
        • +
        • 大学物理
        • +
        • ......
        • +
        diff --git "a/site/JY_HU/1 \346\225\260\345\255\227\351\200\273\350\276\221\350\256\276\350\256\241/\346\225\260\345\255\227\351\200\273\350\276\221\350\256\276\350\256\241 notes/index.html" "b/site/JY_HU/1 \346\225\260\345\255\227\351\200\273\350\276\221\350\256\276\350\256\241/\346\225\260\345\255\227\351\200\273\350\276\221\350\256\276\350\256\241 notes/index.html" index 415f0690..fb0075a4 100644 --- "a/site/JY_HU/1 \346\225\260\345\255\227\351\200\273\350\276\221\350\256\276\350\256\241/\346\225\260\345\255\227\351\200\273\350\276\221\350\256\276\350\256\241 notes/index.html" +++ "b/site/JY_HU/1 \346\225\260\345\255\227\351\200\273\350\276\221\350\256\276\350\256\241/\346\225\260\345\255\227\351\200\273\350\276\221\350\256\276\350\256\241 notes/index.html" @@ -2553,7 +2553,7 @@ -

        数字逻辑设计 notes

        +

        数字逻辑设计 notes

        SOP:sum of minterms

        对函数求complement

        Implicant: squares in the map

        @@ -2563,15 +2563,15 @@

        简单来说就是如果没有这个圈有的格子就包裹不进去,就是 essential prime implicant

        1.3 implicant 蕴含项其实就是我们文章最开始提到的“圈”,每一种可能的圈就是一个蕴含项

        -

        在这里插入图片描述

        +

        在这里插入图片描述

        上图中就有7个一次蕴含项,6个二次蕴含项和1个四次蕴含项,共计14个蕴含项

        1.4 prime implicant 质蕴含项就是不能与其它蕴含项合并的蕴含项,在1.3中,我们发现四次蕴含项中有4个二次蕴含项,那么它们就不是质蕴含项

        -

        在这里插入图片描述

        +

        在这里插入图片描述

        可以看到上图中的每一个圈都不能和其它圈合并,所以上图有共计4个质蕴含项

        1.5 essential prime implicant 实质本源蕴含项中必须含有至少一个没被包含在其它蕴含项中的项,而且不能被更大的圈包裹

        -

        在这里插入图片描述

        +

        在这里插入图片描述

        上图中有三个实质本源蕴含项,而我们找到最简SOP的方式就是找到所有的实质本源蕴含项

        cost criteria

        Literal cost L

        @@ -2581,12 +2581,12 @@

        propagation delay \(t_{PHL}\)

        propagation : 传输

        分为transport delay 和 inertia delay(有rejection time属性)

        -

        image-20231015200001435

        -

        image-20231015200046111

        +

        image-20231015200001435

        +

        image-20231015200046111

        三个串联?四个可以吗

        74LS00与非门传输延迟测量:3个74LS00门串联,4个可以吗?

        \((\overline{A B})\)

        -

        image-20231017153245413

        +

        image-20231017153245413

        2-12怎么化简

        4位全加器的延时较长

        因此采用carry look ahead adder

        @@ -2599,7 +2599,7 @@

        分为transport delay 和 i

        同理,C12 = G8~11+ P8~11*C8

        C16 = G12~15+ P12~15*C12

        依赖关系和4位的CLA相似

        -

        Carry Lookahead Adder in VHDL and Verilog with Full-Adders

        +

        Carry Lookahead Adder in VHDL and Verilog with Full-Adders

        小测1 复习

        1、逻辑表达式化简:

        \(A+\overline{A}B=(A+B)(A+\overline{A})=A+B\)

        @@ -2607,7 +2607,7 @@

        \(逻辑表达式可重复使用\)2、门代价计算:

        3、卡诺图化简

        4变量的卡诺图,16个格子,圈的大小为8->1个变量

        -

        image-20231113230459090

        +

        image-20231113230459090

        diff --git "a/site/JY_HU/1 \346\225\260\345\255\227\351\200\273\350\276\221\350\256\276\350\256\241/\346\225\260\351\200\273\345\256\236\351\252\214/index.html" "b/site/JY_HU/1 \346\225\260\345\255\227\351\200\273\350\276\221\350\256\276\350\256\241/\346\225\260\351\200\273\345\256\236\351\252\214/index.html" index a074085c..6352fcf4 100644 --- "a/site/JY_HU/1 \346\225\260\345\255\227\351\200\273\350\276\221\350\256\276\350\256\241/\346\225\260\351\200\273\345\256\236\351\252\214/index.html" +++ "b/site/JY_HU/1 \346\225\260\345\255\227\351\200\273\350\276\221\350\256\276\350\256\241/\346\225\260\351\200\273\345\256\236\351\252\214/index.html" @@ -2511,15 +2511,15 @@ -

        数逻实验过程笔记

        -

        image-20231120201822638

        +

        数逻实验过程笔记

        +

        image-20231120201822638

        发现只要是在这个文件结构下的图片都会正常显示

        因为实际上typora编辑器的设置中拷贝图片时会将assets会单独复制一份

        -

        image-20231120201554458

        +

        image-20231120201554458

        然而,拷贝后进行缩放,就是改为了html格式,就不能够正常渲染?

        -

        image-20231120201906942

        -

        image-20231120202158410

        -

        发现mkdocs在渲染导出HTML时是会将除了md格式的所有东西都拷贝一份到自己的目录下面的

        +

        image-20231120201906942

        +

        image-20231120202158410

        +

        发现mkdocs在渲染导出HTML时是会将除了md格式的所有东西都拷贝一份到自己的目录下面的

        diff --git "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/exams/15-16-middle/index.html" "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/exams/15-16-middle/index.html" index 353020ed..9e45caeb 100644 --- "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/exams/15-16-middle/index.html" +++ "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/exams/15-16-middle/index.html" @@ -2474,14 +2474,13 @@ -

        15-16年期中考试试卷

        -

        +

        15-16年期中考试试卷

        +

        - + 浙江大学2015-16秋冬《数据结构基础》期中模拟练习 -
        +

        +

        -

        - - -
        浙江大学2015-16秋冬《数据结构基础》期中模拟练习
        开始时间01/01/2016 8:00:00 AM
        结束时间01/18/2038 8:00:00 AM
        答题时长90分钟
        考生
        得分43
        总分104

        判断题得分:8总分:10
        R1-1

        N(logN)2N(logN)^2 is O(N2)O(N^2).

        -
        (2分)
        评测结果答案正确(2 分)
        R1-2

        If the postorder and inorder traversal sequences of a binary tree are the same, then none of the nodes in the tree has a right child.

        -
        (2分)
        评测结果答案正确(2 分)
        R1-3

        The best "worst-case time complexity" for any algorithm that sorts by comparisons only must be O(NlogN)O(NlogN).

        -
        (2分)
        评测结果答案正确(2 分)
        R1-4

        If the most commonly used operations are to visit a random position and to insert and delete the last element in a linear list, then sequential storage works the fastest.

        -
        (2分)
        评测结果答案正确(2 分)
        R1-5

        Given the input sequence onto a stack as {1, 2, 3, ..., NN}. If the first output is ii, then the jj-th output must be ji1j-i-1.

        -
        (2分)
        评测结果答案错误(0 分)
        单选题得分:30总分:64
        R2-1

        Given a tree of degree 4. Suppose that the numbers of nodes of degrees 2, 3 and 4 are 4, 2 and 1, respectively. Then the number of leaf nodes must be:

        -
        (6分)
        D.

        20

        +

        + + +
        浙江大学2015-16秋冬《数据结构基础》期中模拟练习
        开始时间01/01/2016 8:00:00 AM
        结束时间01/18/2038 8:00:00 AM
        答题时长90分钟
        考生
        得分43
        总分104

        判断题得分:8总分:10
        R1-1

        N(logN)2N(logN)^2 is O(N2)O(N^2).

        +
        (2分)
        评测结果答案正确(2 分)
        R1-2

        If the postorder and inorder traversal sequences of a binary tree are the same, then none of the nodes in the tree has a right child.

        +
        (2分)
        评测结果答案正确(2 分)
        R1-3

        The best "worst-case time complexity" for any algorithm that sorts by comparisons only must be O(NlogN)O(NlogN).

        +
        (2分)
        评测结果答案正确(2 分)
        R1-4

        If the most commonly used operations are to visit a random position and to insert and delete the last element in a linear list, then sequential storage works the fastest.

        +
        (2分)
        评测结果答案正确(2 分)
        R1-5

        Given the input sequence onto a stack as {1, 2, 3, ..., NN}. If the first output is ii, then the jj-th output must be ji1j-i-1.

        +
        (2分)
        评测结果答案错误(0 分)
        单选题得分:30总分:64
        R2-1

        Given a tree of degree 4. Suppose that the numbers of nodes of degrees 2, 3 and 4 are 4, 2 and 1, respectively. Then the number of leaf nodes must be:

        +
        (6分)
        评测结果答案错误(0 分)
        R2-2

        Suppose that an array of size m is used to store a circular queue. If the front position is front and the current size is size, then the rear element must be at:

        -
        (6分)
        评测结果答案错误(0 分)
        R2-3

        Insert {5, 2, 7, 3, 4, 1, 6} one by one into an initially empty min-heap. The preorder traversal sequence of the resulting tree is:

        -
        (6分)
        评测结果答案正确(6 分)
        R2-4

        Among the following methods, which one's time complexity is always O(NlogN)O(NlogN), no matter what the initial condition is?

        -
        (3分)
        评测结果答案正确(6 分)
        R2-4

        Among the following methods, which one's time complexity is always O(NlogN)O(NlogN), no matter what the initial condition is?

        +
        (3分)
        评测结果答案错误(0 分)
        R2-5

        Suppose that the height of a binary tree is hh (the height of a leaf node is defined to be 1), and it has only the nodes of degrees 0 and 2. Then the minimum and maximum possible total numbers of nodes are:

        -
        (6分)
        评测结果答案错误(0 分)
        R2-6

        Suppose that the level-order traversal sequence of a min-heap is {1, 3, 2, 5, 4, 7, 6}. Use the linear algorithm to adjust this min-heap into a max-heap. The inorder traversal sequence of the resulting tree is:

        -
        (6分)
        评测结果答案正确(6 分)
        R2-7

        To delete p from a doubly linked list, we must do:

        -
        (6分)
        评测结果答案正确(6 分)
        R2-8

        If on the 9th level of a complete binary tree (assume that the root is on the 1st level) there are 100 leaf nodes, then the maximum number of nodes of this tree must be:

        -
        (6分)
        评测结果答案正确(6 分)
        R2-9

        The array representation of a disjoint set containing numbers 0 to 8 is given by { 1, -4, 1, 1, -3, 4, 4, 8, -2 }. Then to union the two sets which contain 6 and 8 (with union-by-size), the index of the resulting root and the value stored at the root are:

        -
        (6分)
        评测结果答案错误(0 分)
        R2-10

        For a binary search tree, in which order of traversal that we can obtain a non-decreasing sequence?

        -
        (3分)
        评测结果答案正确(3 分)
        R2-11

        Given input { 321, 156, 57, 46, 28, 7, 331, 33, 34, 63 }. Which one of the following is the result after the 1st run of the Least Signification Digit (LSD) radix sort?

        -
        (4分)
        评测结果答案错误(0 分)
        R2-12

        Which one of the following relations is correct about the extra space taken by heap sort, quick sort and merge sort?

        -
        (3分)
        评测结果答案错误(0 分)
        R2-13

        Given the pushing sequence of a stack as {1, 2, 3, 4, 5}. If the first number being popped out is 4, then the last one out must be:

        -
        (3分)
        评测结果答案正确(3 分)
        程序填空题得分:0总分:10
        R5-1

        The function is to increase the value of the integer key at position P by a positive amount D in a max-heap H.

        void IncreaseKey( int P, int D, PriorityQueue H )
         {
            int i, key;
            key = H->Elements[P] + D;
        -   for ( i = (3分); H->Elements[i/2] < key; i/=2 )
        -      (3分);
        +   for ( i = (3分); H->Elements[i/2] < key; i/=2 )
        +      (3分);
            H->Elements[i] = key;
        -}
        +}
        序号结果测试点得分
        0编译错误0
        1未作答0
        评测结果多种错误(0 分)
        函数题得分:5总分:20
        R6-1
        No Greater Than X in BST
        (20分)

        You are supposed to output, in decreasing order, all the elements no greater than X in a binary search tree T.

        Format of function:

        -
        void Print_NGT( Tree T,  int X );
        +
        void Print_NGT( Tree T,  int X );

        where Tree is defined as the following:

        typedef struct TreeNode *Tree;
         struct TreeNode {
             int Element;
             Tree  Left;
             Tree  Right;
        -};
        +};

        The function is supposed to use Output(X) to print X.

        Sample program of judge:

        #include <stdio.h>
        @@ -2718,36 +2717,36 @@ 

        Sample program of judge:

        int X; T = BuildTree(); - scanf("%d", &X); + scanf("%d", &X); Print_NGT( T, X ); - printf("End\n"); + printf("End\n"); return 0; } /* Your function will be put here */ -
        +

        Sample Output 1 (for the tree shown in Figure 1):

        -
        91 90 85 81 80 55 End
        +
        91 90 85 81 80 55 End

        Sample Output 2 (for the tree shown in Figure 2):

        -
        End
        +
        End
        编译器
        GCC
        代码
        void Print_NGT( Tree T,  int X ) {
             return;
         }
        编译器输出
        a.c: In function ‘BuildTree’:
         a.c:33:6: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
        -      scanf("%d", &n);
        +      scanf("%d", &n);
               ^~~~~~~~~~~~~~~
         a.c:35:10: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
        -          scanf("%d", &x);
        +          scanf("%d", &x);
                   ^~~~~~~~~~~~~~~
         a.c: In function ‘main’:
         a.c:52:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
        -     scanf("%d", &X);
        +     scanf("%d", &X);
              ^~~~~~~~~~~~~~~
        测试点结果测试点得分耗时内存
        0答案错误04.00 ms312 KB
        1答案正确34.00 ms432 KB
        2答案错误04.00 ms336 KB
        3答案正确24.00 ms352 KB
        4答案错误04.00 ms384 KB
        评测结果部分正确(5 分)
        - +
        diff --git "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/exams/16-17-middle/index.html" "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/exams/16-17-middle/index.html" index 7aaf549e..7e622fb7 100644 --- "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/exams/16-17-middle/index.html" +++ "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/exams/16-17-middle/index.html" @@ -2474,14 +2474,13 @@ -

        16-17年期中考试试卷

        -

        +

        16-17年期中考试试卷

        +

        - + 浙江大学2016-17秋冬《数据结构基础》期中模拟练习 -
        +

        +

        -

        - - -
        浙江大学2016-17秋冬《数据结构基础》期中模拟练习
        开始时间01/01/2016 8:00:00 AM
        结束时间01/18/2038 8:00:00 AM
        答题时长45分钟
        考生
        得分17
        总分100

        判断题得分:12总分:15
        R1-1

        In a binary search tree, the keys on the same level from left to right must be in sorted (non-decreasing) order.

        -
        (3分)
        评测结果答案正确(3 分)
        R1-2

        For a sequentially stored linear list of length NN, the time complexities for query and insertion are O(1)O(1) and O(N)O(N), respectively.

        -
        (3分)
        评测结果答案正确(3 分)
        R1-3

        2N2^N and NNN^N have the same speed of growth.

        -
        (3分)
        评测结果答案错误(0 分)
        R1-4

        In a directed graph, the sum of the in-degrees must be equal to the sum of the out-degrees of all the vertices.

        -
        (3分)
        评测结果答案正确(3 分)
        R1-5

        If keys are pushed onto a stack in the order {1, 2, 3, 4, 5}, then it is impossible to obtain the output sequence {3, 4, 1, 2, 5}.

        -
        (3分)
        评测结果答案正确(3 分)
        单选题得分:0总分:65
        R2-1

        Suppose that an array of size m is used to store a circular queue. If the front position is front and the current size is size, then the rear element must be at:

        -
        (5分)
        D.

        (front+size)%m

        +

        + + +
        浙江大学2016-17秋冬《数据结构基础》期中模拟练习
        开始时间01/01/2016 8:00:00 AM
        结束时间01/18/2038 8:00:00 AM
        答题时长45分钟
        考生
        得分17
        总分100

        判断题得分:12总分:15
        R1-1

        In a binary search tree, the keys on the same level from left to right must be in sorted (non-decreasing) order.

        +
        (3分)
        评测结果答案正确(3 分)
        R1-2

        For a sequentially stored linear list of length NN, the time complexities for query and insertion are O(1)O(1) and O(N)O(N), respectively.

        +
        (3分)
        评测结果答案正确(3 分)
        R1-3

        2N2^N and NNN^N have the same speed of growth.

        +
        (3分)
        评测结果答案错误(0 分)
        R1-4

        In a directed graph, the sum of the in-degrees must be equal to the sum of the out-degrees of all the vertices.

        +
        (3分)
        评测结果答案正确(3 分)
        R1-5

        If keys are pushed onto a stack in the order {1, 2, 3, 4, 5}, then it is impossible to obtain the output sequence {3, 4, 1, 2, 5}.

        +
        (3分)
        评测结果答案正确(3 分)
        单选题得分:0总分:65
        R2-1

        Suppose that an array of size m is used to store a circular queue. If the front position is front and the current size is size, then the rear element must be at:

        +
        (5分)
        评测结果答案错误(0 分)
        R2-2

        The result of performing three DeleteMin operations in the min-heap {1,3,2,6,7,5,4,15,14,12,9,10,11,13,8} is:

        -
        (5分)
        评测结果答案错误(0 分)
        R2-3

        In a complete binary tree with 1102 nodes, there must be __ leaf nodes.

        -
        (6分)
        评测结果答案错误(0 分)
        R2-4

        Use Dijkstra algorithm to find the shortest paths from 1 to every other vertices. In which order that the destinations must be obtained?

        -
        (5分)
        评测结果答案错误(0 分)
        R2-5

        Given a directed graph G=(V, E) where V = {v1, v2, v3, v4, v5, v6} and E = {<v1,v2>, <v1,v4>, <v2,v6>, <v3,v1>, <v3,v4>, <v4,v5>, <v5,v2>, <v5,v6>}. Then the topological order of G is:

        -
        (5分)
        评测结果答案错误(0 分)
        R2-6

        In a weighted graph, if the length of the shortest path from b to a is 10, and there exists an edge of weight 3 between c and b, then how many of the following statements is/are TRUE?

        1. The length of the shortest path from c to a must be 13.
        2. @@ -2644,64 +2643,64 @@

          16-17年期中考试试卷

        3. The length of the shortest path from c to a must be no greater than 13.
        4. The length of the shortest path from c to a must be no less than 7.
        -
        (6分)
        评测结果答案错误(0 分)
        R2-7

        The array representation of a disjoint set is given by { 4, 6, 5, 2, -3, -4, 3 }. If the elements are numbered from 1 to 7, the resulting array after invoking Union(Find(7),Find(1)) with union-by-size and path-compression is:

        -
        (5分)
        评测结果答案错误(0 分)
        R2-8

        Given a quadtree(四叉树) with 3 nodes of degree 2, 2 nodes of degree 3, 4 nodes of degree 4. The number of leaf nodes in this tree is __.

        -
        (5分)
        评测结果答案错误(0 分)
        R2-9

        What is a critical path in an AOE network?

        -
        (5分)
        评测结果答案错误(0 分)
        R2-10

        Insert { 6, 9, 12, 3, 4, 8 } one by one into an initially empty binary search tree. The post-order traversal sequence of the resulting tree is:

        -
        (6分)
        评测结果答案错误(0 分)
        R2-11

        To insert s after p in a doubly linked circular list, we must do:

        -
        (6分)
        评测结果答案错误(0 分)
        R2-12

        If an undirected graph G = (V, E) contains 7 vertices. Then to guarantee that G is connected in any cases, there has to be at least ____ edges.

        -
        (6分)
        评测结果答案错误(0 分)
        程序填空题得分:5总分:20
        R5-1

        The function is to lower the value of the integer key at position P by a positive amount D in a min-heap H.

        void DecreaseKey( int P, int D, PriorityQueue H )
         {
            int i, key;
            key = H->Elements[P] - D;
        -   for ( i = (5分); H->Elements[i/2] > key; i/=2 )
        -      (5分);
        +   for ( i = (5分); H->Elements[i/2] > key; i/=2 )
        +      (5分);
            H->Elements[i] = key;
        -}
        +}
        评测结果未作答(0 分)
        R5-2

        Please fill in the blanks in the program which performs Find as a Union/Find operation with path compression.

        SetType Find ( ElementType X, DisjSet S )
         {   
            ElementType root, trail, lead;
         
        -   for ( root = X; S[root] > 0; (5分) ) ;  
        +   for ( root = X; S[root] > 0; (5分) ) ;  
            for ( trail = X; trail != root; trail = lead ) {
               lead = S[trail] ;   
        -      (5分);   
        +      (5分);   
            } 
            return root;
        -}
        +}
        序号结果测试点得分
        0答案正确5
        1未作答0
        评测结果部分正确(5 分)
        - +
        diff --git "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/exams/17-18-middle/index.html" "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/exams/17-18-middle/index.html" index f678f5b1..2ed00cbc 100644 --- "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/exams/17-18-middle/index.html" +++ "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/exams/17-18-middle/index.html" @@ -2474,14 +2474,13 @@ -

        17-18年期中考试试卷

        -

        +

        17-18年期中考试试卷

        +

        - + 浙江大学2017-18秋冬《数据结构基础》期中模拟练习 -
        +

        +

        -

        - - -
        浙江大学2017-18秋冬《数据结构基础》期中模拟练习
        开始时间01/01/2016 8:00:00 AM
        结束时间01/18/2038 8:00:00 AM
        答题时长45分钟
        考生
        得分27
        总分100

        判断题得分:9总分:15
        R1-1

        If keys are pushed onto a stack in the order {1, 2, 3, 4, 5}, then it is impossible to obtain the output sequence {3, 4, 1, 2, 5}.

        -
        (3分)
        评测结果答案正确(3 分)
        R1-2

        For a sequentially stored linear list of length NN, the time complexities for deleting the first element and inserting the last element are O(1)O(1) and O(N)O(N), respectively.

        -
        (3分)
        评测结果答案错误(0 分)
        R1-3

        The sum of the degrees of all the vertices in a connected graph must be an even number.

        -
        (3分)
        评测结果答案正确(3 分)
        R1-4

        In a binary search tree, the keys on the same level from left to right must be in sorted (non-decreasing) order.

        -
        (3分)
        评测结果答案正确(3 分)
        R1-5

        N2logNN^2 logN and NlogN2N logN^2 have the same speed of growth.

        -
        (3分)
        评测结果答案错误(0 分)
        单选题得分:18总分:65
        R2-1

        How many leaf node does a complete binary tree with 2435 nodes have?

        -
        (6分)
        D.

        812

        +

        + + +
        浙江大学2017-18秋冬《数据结构基础》期中模拟练习
        开始时间01/01/2016 8:00:00 AM
        结束时间01/18/2038 8:00:00 AM
        答题时长45分钟
        考生
        得分27
        总分100

        判断题得分:9总分:15
        R1-1

        If keys are pushed onto a stack in the order {1, 2, 3, 4, 5}, then it is impossible to obtain the output sequence {3, 4, 1, 2, 5}.

        +
        (3分)
        评测结果答案正确(3 分)
        R1-2

        For a sequentially stored linear list of length NN, the time complexities for deleting the first element and inserting the last element are O(1)O(1) and O(N)O(N), respectively.

        +
        (3分)
        评测结果答案错误(0 分)
        R1-3

        The sum of the degrees of all the vertices in a connected graph must be an even number.

        +
        (3分)
        评测结果答案正确(3 分)
        R1-4

        In a binary search tree, the keys on the same level from left to right must be in sorted (non-decreasing) order.

        +
        (3分)
        评测结果答案正确(3 分)
        R1-5

        N2logNN^2 logN and NlogN2N logN^2 have the same speed of growth.

        +
        (3分)
        评测结果答案错误(0 分)
        单选题得分:18总分:65
        R2-1

        How many leaf node does a complete binary tree with 2435 nodes have?

        +
        (6分)
        评测结果答案正确(6 分)
        R2-2

        The result of performing three DeleteMin operations in the min-heap {1,3,2,6,7,5,4,15,14,12,9,10,11,13,8} is:

        -
        (5分)
        评测结果答案错误(0 分)
        R2-3

        The array representation of a disjoint set is given by { 4, 6, 5, 2, -3, -4, 3 }. If the elements are numbered from 1 to 7, the resulting array after invoking Union(Find(7),Find(1)) with union-by-size and path-compression is:

        -
        (5分)
        评测结果答案错误(0 分)
        R2-4

        Insert { 6, 9, 12, 3, 4, 8 } one by one into an initially empty binary search tree. The post-order traversal sequence of the resulting tree is:

        -
        (6分)
        评测结果答案错误(0 分)
        R2-5

        In-order traversal of a binary tree can be done iteratively. Given the stack operation sequence as the following:

        -
        push(1), push(2), push(3), pop(), push(4), pop(), pop(), push(5), pop(), pop(), push(6), pop()
        +
        push(1), push(2), push(3), pop(), push(4), pop(), pop(), push(5), pop(), pop(), push(6), pop()

        Which one of the following statements is TRUE?

        -
        (6分)
        评测结果答案正确(6 分)
        R2-6

        The recurrent equations for the time complexities of programs P1 and P2 are:

        • P1: T(1)=1T(1)=1, T(N)=T(N/2)+1T(N)=T(N/2)+1;
        • P2: T(1)=1T(1)=1, T(N)=2T(N/2)+1T(N)=2T(N/2)+1;

        Then the best conclusion about their time complexities is:

        -
        (5分)
        评测结果答案错误(0 分)
        R2-7

        From the given graph shown by the figure, how many different topological orders can we obtain?

        -
        (5分)
        评测结果答案错误(0 分)
        R2-8

        If an undirected graph G = (V, E) contains 7 vertices. Then to guarantee that G is connected in any cases, there has to be at least ____ edges.

        -
        (6分)
        评测结果答案错误(0 分)
        R2-9

        To delete p from a doubly linked list, we must do:

        -
        (6分)
        评测结果答案正确(6 分)
        R2-10

        Which of the following statements is TRUE about topological sorting?

        -
        (5分)
        评测结果答案错误(0 分)
        R2-11

        Given a quadtree(四叉树) with 4 nodes of degree 2, 4 nodes of degree 3, 3 nodes of degree 4. The number of leaf nodes in this tree is __.

        -
        (5分)
        评测结果答案错误(0 分)
        R2-12

        Suppose that an array of size m is used to store a circular queue. If the front position is front and the current size is size, then the rear element must be at:

        -
        (5分)
        评测结果答案错误(0 分)
        程序填空题得分:0总分:20
        R5-1

        The function is to find the K-th largest element in a list A of N elements. The function BuildMinHeap(H, K) is to arrange elements H[1] ... H[K] into a min-heap. Please complete the following program.

        ElementType FindKthLargest ( int A[], int N, int K )
         {   /* it is assumed that K<=N */
        @@ -2694,8 +2693,8 @@ 

        17-18年期中考试试卷

        if ( H[0] > H[1] ) { for ( i=1; i*2<=K; i=child ) { child = i*2; - if ( child!=K && (5分) ) child++; - if ( (5分) ) + if ( child!=K && (5分) ) child++; + if ( (5分) ) H[i] = H[child]; else break; } @@ -2704,22 +2703,22 @@

        17-18年期中考试试卷

        } return H[1]; } -
        +
        序号结果测试点得分
        0编译错误0
        1未作答0
        评测结果多种错误(0 分)
        R5-2

        Please fill in the blanks in the program which performs Find as a Union/Find operation with path compression.

        SetType Find ( ElementType X, DisjSet S )
         {   
            ElementType root, trail, lead;
         
        -   for ( root = X; S[root] > 0; (5分) ) ;  
        +   for ( root = X; S[root] > 0; (5分) ) ;  
            for ( trail = X; trail != root; trail = lead ) {
               lead = S[trail] ;   
        -      (5分);   
        +      (5分);   
            } 
            return root;
        -}
        +}
        序号结果测试点得分
        0编译错误0
        1未作答0
        评测结果多种错误(0 分)
        - +
        diff --git "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/exams/18-19-middle/index.html" "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/exams/18-19-middle/index.html" index b7dd3129..9c7023bd 100644 --- "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/exams/18-19-middle/index.html" +++ "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/exams/18-19-middle/index.html" @@ -2474,14 +2474,13 @@ -

        18-19年期中考试试卷

        -

        +

        18-19年期中考试试卷

        +

        - + 浙江大学2018-19秋冬《数据结构基础》期中模拟练习 -
        +

        +

        -

        - - -
        浙江大学2018-19秋冬《数据结构基础》期中模拟练习
        开始时间01/01/2016 8:00:00 AM
        结束时间01/18/2038 8:00:00 AM
        答题时长90分钟
        考生
        得分19
        总分100

        判断题得分:12总分:15
        R1-1

        2N2^N and NNN^N have the same speed of growth.

        -
        (3分)
        评测结果答案错误(0 分)
        R1-2

        If keys are pushed onto a stack in the order {1, 2, 3, 4, 5}, then it is impossible to obtain the output sequence {3, 4, 1, 2, 5}.

        -
        (3分)
        评测结果答案正确(3 分)
        R1-3

        If there are less than 20 inversions in an integer array, then Insertion Sort will be the best method among Quick Sort, Heap Sort and Insertion Sort.

        -
        (3分)
        评测结果答案正确(3 分)
        R1-4

        For a sequentially stored linear list of length NN, the time complexities for query and insertion are O(1)O(1) and O(N)O(N), respectively.

        -
        (3分)
        评测结果答案正确(3 分)
        R1-5

        In a binary search tree, the keys on the same level from left to right must be in sorted (non-decreasing) order.

        -
        (3分)
        评测结果答案正确(3 分)
        单选题得分:5总分:64
        R2-1

        The recurrent equations for the time complexities of programs P1 and P2 are:

        +

        + + +
        浙江大学2018-19秋冬《数据结构基础》期中模拟练习
        开始时间01/01/2016 8:00:00 AM
        结束时间01/18/2038 8:00:00 AM
        答题时长90分钟
        考生
        得分19
        总分100

        判断题得分:12总分:15
        R1-1

        2N2^N and NNN^N have the same speed of growth.

        +
        (3分)
        评测结果答案错误(0 分)
        R1-2

        If keys are pushed onto a stack in the order {1, 2, 3, 4, 5}, then it is impossible to obtain the output sequence {3, 4, 1, 2, 5}.

        +
        (3分)
        评测结果答案正确(3 分)
        R1-3

        If there are less than 20 inversions in an integer array, then Insertion Sort will be the best method among Quick Sort, Heap Sort and Insertion Sort.

        +
        (3分)
        评测结果答案正确(3 分)
        R1-4

        For a sequentially stored linear list of length NN, the time complexities for query and insertion are O(1)O(1) and O(N)O(N), respectively.

        +
        (3分)
        评测结果答案正确(3 分)
        R1-5

        In a binary search tree, the keys on the same level from left to right must be in sorted (non-decreasing) order.

        +
        (3分)
        评测结果答案正确(3 分)
        单选题得分:5总分:64
        R2-1

        The recurrent equations for the time complexities of programs P1 and P2 are:

        • P1: T(1)=1T(1)=1, T(N)=T(N/2)+1T(N)=T(N/2)+1;
        • P2: T(1)=1T(1)=1, T(N)=2T(N/2)+1T(N)=2T(N/2)+1;

        Then the best conclusion about their time complexities is:

        -
        (5分)
        评测结果答案错误(0 分)
        R2-2

        To delete p from a doubly linked list, we must do:

        -
        (5分)
        评测结果答案错误(0 分)
        R2-3

        Given input {15, 9, 7, 8, 20, -1, 4}. If the result of the 1st run of Shell sort is {15, -1, 4, 8, 20, 9, 7}, then the initial increment must be:

        -
        (5分)
        评测结果答案错误(0 分)
        R2-4

        In-order traversal of a binary tree can be done iteratively. Given the stack operation sequence as the following:

        -
        push(1), push(2), push(3), pop(), push(4), pop(), pop(), push(5), pop(), pop(), push(6), pop()
        +
        push(1), push(2), push(3), pop(), push(4), pop(), pop(), push(5), pop(), pop(), push(6), pop()

        Which one of the following statements is TRUE?

        -
        (5分)
        评测结果答案错误(0 分)
        R2-5

        How many leaf node does a complete binary tree with 2435 nodes have?

        -
        (5分)
        评测结果答案错误(0 分)
        R2-6

        Suppose that an array of size m is used to store a circular queue. If the head pointer front and the current size variable size are used to represent the range of the queue instead of front and rear, then the maximum capacity of this queue can be:

        -
        (5分)
        评测结果答案错误(0 分)
        R2-7

        Given input { 4321, 56, 57, 46, 28, 7, 331, 33, 234, 63 }. Which one of the following is the result after the 1st run of the Least Signification Digit (LSD) radix sort?

        -
        (5分)
        评测结果答案正确(5 分)
        R2-8

        Given a quadtree(四叉树) with 4 nodes of degree 2, 4 nodes of degree 3, 3 nodes of degree 4. The number of leaf nodes in this tree is __.

        -
        (5分)
        评测结果答案错误(0 分)
        R2-9

        For an in-order threaded binary tree, if the pre-order and in-order traversal sequences are B E A C F D and A E C B D F respectively, which pair of nodes' left links are both threads?

        -
        (4分)
        评测结果答案错误(0 分)
        R2-9

        For an in-order threaded binary tree, if the pre-order and in-order traversal sequences are B E A C F D and A E C B D F respectively, which pair of nodes' left links are both threads?

        +
        (4分)
        评测结果答案错误(0 分)
        R2-10

        The result of performing three DeleteMin operations in the min-heap {1,3,2,12,6,4,8,15,14,9,7,5,11,13,10} is:

        -
        (5分)
        评测结果答案错误(0 分)
        R2-11

        For the quicksort implementation with the left pointer stops at an element with the same key as the pivot during the partitioning, but the right pointer does not stop in a similar case, what is the running time when all keys are equal?

        -
        (5分)
        评测结果答案错误(0 分)
        R2-12

        Among the following sorting methods, which ones will be slowed down if we store the elements in a linked structure instead of a sequential structure?

        1. Insertion sort; 2. Selection Sort; 3. Bubble sort; 4. Shell sort; 5. Heap sort
        -
        (5分)
        评测结果答案错误(0 分)
        R2-13

        Insert { 3, 8, 9, 1, 2, 6 } one by one into an initially empty binary search tree. The post-order traversal sequence of the resulting tree is:

        -
        (5分)
        评测结果答案错误(0 分)
        程序填空题得分:0总分:15
        R5-1

        The function is to find the K-th smallest element in a list A of N elements. The function BuildMaxHeap(H, K) is to arrange elements H[1] ... H[K] into a max-heap. Please complete the following program.

        ElementType FindKthSmallest ( int A[], int N, int K )
         {   /* it is assumed that K<=N */
        @@ -2701,8 +2700,8 @@ 

        18-19年期中考试试卷

        if ( H[0] < H[1] ) { for ( i=1; i*2<=K; i=child ) { child = i*2; - if ( child!=K && (3分) ) child++; - if ( (3分) ) + if ( child!=K && (3分) ) child++; + if ( (3分) ) H[i] = H[child]; else break; } @@ -2711,7 +2710,7 @@

        18-19年期中考试试卷

        } return H[1]; } -
        +
        序号结果测试点得分
        0编译错误0
        1未作答0
        评测结果多种错误(0 分)
        R5-2

        The function is to sort the list { r[1] … r[n] } in non-decreasing order. Unlike selection sort which places only the minimum unsorted element in its correct position, this algorithm finds both the minimum and the maximum unsorted elements and places them into their final positions.

        void  sort( list r[], int n )  
         {
        @@ -2719,27 +2718,27 @@ 

        18-19年期中考试试卷

        for (i=1; i<n-i+1; i++) { mini = maxi = i; - for( j=i+1; (3分); ++j ){ - if( (3分) ) mini = j; + for( j=i+1; (3分); ++j ){ + if( (3分) ) mini = j; else if(r[j]->key > r[maxi]->key) maxi = j; } if( mini != i ) swap(&r[mini], &r[i]); if( maxi != n-i+1 ){ - if( (3分) ) swap(&r[mini], &r[n-i+1]); + if( (3分) ) swap(&r[mini], &r[n-i+1]); else swap(&r[maxi], &r[n-i+1]); } } -}
        +}
        评测结果未作答(0 分)
        函数题得分:2总分:6
        R6-1
        No Less Than X in BST
        (6分)

        You are supposed to output, in decreasing order, all the elements no less than X in a binary search tree T.

        Format of function:

        -
        void Print_NLT( Tree T,  int X );
        +
        void Print_NLT( Tree T,  int X );

        where Tree is defined as the following:

        typedef struct TreeNode *Tree;
         struct TreeNode {
             int Element;
             Tree  Left;
             Tree  Right;
        -};
        +};

        The function is supposed to use Output(X) to print X.

        Sample program of judge:

        #include <stdio.h>
        @@ -2763,17 +2762,17 @@ 

        Sample program of judge:

        int X; T = BuildTree(); - scanf("%d", &X); + scanf("%d", &X); Print_NLT( T, X ); - printf("End\n"); + printf("End\n"); return 0; } /* Your function will be put here */ -
        +

        Sample Output 1 (for the tree shown in Figure 1):

        -
        92 91 90 85 81 80 End
        +
        92 91 90 85 81 80 End

        @@ -2781,7 +2780,7 @@

        Sample Output 1 (for the

        Sample Output 2 (for the tree shown in Figure 2):

        -
        End
        +
        End

        @@ -2790,17 +2789,17 @@

        Sample Output 2 (for the return; }

        编译器输出
        a.c: In function ‘BuildTree’:
         a.c:33:6: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
        -      scanf("%d", &n);
        +      scanf("%d", &n);
               ^~~~~~~~~~~~~~~
         a.c:35:10: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
        -          scanf("%d", &x);
        +          scanf("%d", &x);
                   ^~~~~~~~~~~~~~~
         a.c: In function ‘main’:
         a.c:52:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
        -     scanf("%d", &X);
        +     scanf("%d", &X);
              ^~~~~~~~~~~~~~~
        测试点结果测试点得分耗时内存
        0答案错误05.00 ms316 KB
        1答案正确14.00 ms384 KB
        2答案错误05.00 ms356 KB
        3答案正确14.00 ms324 KB
        4答案错误05.00 ms400 KB
        评测结果部分正确(2 分)
        - +
        diff --git "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/exams/19-20-middle/index.html" "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/exams/19-20-middle/index.html" index 3450c46e..49f14ba4 100644 --- "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/exams/19-20-middle/index.html" +++ "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/exams/19-20-middle/index.html" @@ -2474,14 +2474,13 @@ -

        19-20年期中考试试卷

        -

        +

        19-20年期中考试试卷

        +

        - + 浙江大学2019-20秋冬《数据结构基础》期中模拟练习(45分钟) -
        +

        +

        -

        - +

        -
        浙江大学2019-20秋冬《数据结构基础》期中模拟练习(45分钟)
        开始时间01/01/2016 8:00:00 AM
        结束时间01/18/2038 8:00:00 AM
        答题时长45分钟
        考生
        得分38
        总分100

        判断题得分:12总分:15
        R1-1

        NlogN\sqrt{N}logN is O(N)O(N).

        -
        (3分)
        评测结果答案正确(3 分)
        R1-2

        In Union/Find algorithm, if Unions are done by size, the depth of any node must be no more than N/2N/2, but not O(logN)O(logN).

        -
        (3分)
        评测结果答案错误(0 分)
        R1-3

        If a linear list is represented by a 1-dimensional array, the addresses of the elements in the memory must be consecutive.

        -
        (3分)
        评测结果答案正确(3 分)
        R1-4

        ADT is the abbreviation for Abstract Data Type in the textbook of data structures.

        -
        (3分)
        评测结果答案正确(3 分)
        R1-5

        In a directed graph, the sum of the in-degrees must be equal to the sum of the out-degrees of all the vertices.

        -
        (3分)
        评测结果答案正确(3 分)
        单选题得分:26总分:60
        R2-1

        If a binary search tree of NN nodes is also a complete binary tree, then among the following, which one is FALSE?

        -
        (5分)
        评测结果答案正确(3 分)
        R1-2

        In Union/Find algorithm, if Unions are done by size, the depth of any node must be no more than N/2N/2, but not O(logN)O(logN).

        +
        (3分)
        评测结果答案错误(0 分)
        R1-3

        If a linear list is represented by a 1-dimensional array, the addresses of the elements in the memory must be consecutive.

        +
        (3分)
        评测结果答案正确(3 分)
        R1-4

        ADT is the abbreviation for Abstract Data Type in the textbook of data structures.

        +
        (3分)
        评测结果答案正确(3 分)
        R1-5

        In a directed graph, the sum of the in-degrees must be equal to the sum of the out-degrees of all the vertices.

        +
        (3分)
        评测结果答案正确(3 分)
        单选题得分:26总分:60
        R2-1

        If a binary search tree of NN nodes is also a complete binary tree, then among the following, which one is FALSE?

        +
        (5分)
        评测结果答案正确(5 分)
        R2-2

        The following figure shows the AOE network of a project with 8 activities. The earliest and the latest start times of the activity d are __, respectively.

        GRE19-5.jpg

        -
        (5分)
        评测结果答案正确(5 分)
        R2-3

        list.jpg

        Which one of the following is the data structure that is best represented by the above picture?

        -
        (1分)
        评测结果答案正确(1 分)
        R2-4

        For a sequentially stored linear list of length NN, the time complexities for query and insertion are:

        -
        (5分)
        评测结果答案错误(0 分)
        R2-5

        If graph G is NOT connected and has 27 edges, then it must have at least ____ vertices.

        -
        (5分)
        评测结果答案错误(0 分)
        R2-6

        A full tree of degree 3 is a tree in which every node other than the leaves has 3 children. How many leaves does a full tree of degree 3 have if it has 127 nodes?

        -
        (5分)
        评测结果答案正确(5 分)
        R2-7

        Since the speed of a printer cannot match the speed of a computer, a buffer is designed to temperarily store the data from a computer so that later the printer can retrieve data in order. Then the proper structure of the buffer shall be a:

        -
        (5分)
        评测结果答案正确(5 分)
        R2-8

        Let nn be a non-negative integer representing the size of input. The time complexity of the following piece of code is:

        x = 0;
         while ( n >= (x+1)*(x+1) )
        -    x = x+1;
        -
        (5分)
        评测结果答案错误(0 分)
        R2-9

        From the given graph shown by the figure, how many different topological orders can we obtain?

        -
        (5分)
        评测结果答案正确(5 分)
        R2-10

        If besides finding the shortest path from S to every other vertices, we also need to count the number of different shortest paths, we can modify the Dijkstra algorithm in the following way: add an array count[] so that count[V] records the number of different shortest paths from S to V. Then count[V] shall be initialized as:

        -
        (5分)
        评测结果答案错误(0 分)
        R2-11

        Given the shape of a binary tree shown by the figure below. If its postorder traversal sequence is { e, a, c, b, d, f }, then the node on the same level of b must be:

        mt1.JPG

        -
        (5分)
        评测结果答案错误(0 分)
        R2-12

        The array representation of the disjoint sets is given by {2, –4, 2, 3, -3, 5, 6, 9, -2}. Keep in mind that the elements are numbered from 1 to 9. After invoking Union(Find(4), Find(6)) with union-by-size, which elements will be changed in the resulting array?

        -
        (4分)
        评测结果答案错误(0 分)
        R2-13

        Given the popping sequence of a stack as {1, 2, 3, 4, 5}. Among the following, the impossible pushing sequence is:

        -
        (5分)
        评测结果答案错误(0 分)
        程序填空题得分:暂无总分:25
        R5-1

        The function Dijkstra is to find the shortest path from Vertex S to every other vertices in a given Graph. The distances are stored in dist[], and path[] records the paths. The MGraph is defined as the following:

        typedef struct GNode *PtrToGNode;
         struct GNode{
        @@ -2701,7 +2700,7 @@ 

        19-20年期中考试试卷

        int Ne; /* Number of edges */ WeightType G[MaxVertexNum][MaxVertexNum]; /* adjacency matrix */ }; -typedef PtrToGNode MGraph;
        +typedef PtrToGNode MGraph;
        void Dijkstra( MGraph Graph, int dist[], int path[], Vertex S )
         {
             int collected[MaxVertexNum];
        @@ -2721,13 +2720,13 @@ 

        19-20年期中考试试卷

        collected[V] = true; for( W=0; W<Graph->Nv; W++ ) if ( collected[W]==false && Graph->G[V][W]<INFINITY ) { - if ( (4分) ) { - dist[W] = (3分); - path[W] = (3分); + if ( (4分) ) { + dist[W] = (3分); + path[W] = (3分); } } } /* end while */ -}
        +}
        R5-2

        The function is to return the reverse linked list of L, with a dummy header.

        List Reverse( List L )
         {
        @@ -2737,13 +2736,13 @@ 

        19-20年期中考试试卷

        while ( Old_head ) { Temp = Old_head->Next; - (3分); + (3分); New_head = Old_head; Old_head = Temp; } - (3分); + (3分); return L; -}
        +}
        R5-3

        Please fill in the blanks in the program which deletes a given element at position p from a max-heap H.

        Deletion ( PriorityQueue H,  int p )  /* delete the element H->Elements[p] */
         {
        @@ -2753,15 +2752,15 @@ 

        19-20年期中考试试卷

        temp = H-> Elements[ H->Size-- ]; if ( temp > H->Elements[p] ) { while ( (p != 1) && (temp > H->Elements[p/2]) ) { - (3分); + (3分); p /= 2; } } else { while( (child = 2*p) <= H->Size) { - if ( child != H->Size && (3分) ) + if ( child != H->Size && (3分) ) child ++; - if ( (3分) ) { + if ( (3分) ) { H->Elements[p] = H->Elements[child]; p = child; } @@ -2770,10 +2769,10 @@

        19-20年期中考试试卷

        } } H->Elements[p] = temp; -}
        +}
        - +
        diff --git "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/mynotes/FDS-notes/index.html" "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/mynotes/FDS-notes/index.html" index e079f939..8684225f 100644 --- "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/mynotes/FDS-notes/index.html" +++ "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/mynotes/FDS-notes/index.html" @@ -2556,9 +2556,9 @@ -

        FDS-notes-2023

        +

        FDS-notes-2023

        注意复习:填空题,以下内容均可能作为填空

        -

        zigzag.jpg

        +

        zigzag.jpg

        四种遍历顺序

        层序 1 11 5 12 17 8 20 15

        @@ -2722,7 +2722,7 @@

        { for (int i = queue->front; i < queue->front + len; i++) { - printf(" %d", queue->list[i]->data); + printf(" %d", queue->list[i]->data); } } else @@ -2730,9 +2730,9 @@

        for (int i = queue->front + len - 1; i >= queue->front; i--) { if (level == 0) - printf("%d", queue->list[i]->data); + printf("%d", queue->list[i]->data); else - printf(" %d", queue->list[i]->data); + printf(" %d", queue->list[i]->data); } } //到此为止,往上:打印,也就是visit @@ -3277,10 +3277,10 @@

        双端队列 double-ended queue,简称Dequevoid printDeque(struct Deque* deque) { struct Node* current = deque->front; while (current != NULL) { - printf("%d ", current->data); + printf("%d ", current->data); current = current->next; } - printf("\n"); + printf("\n"); } // 主函数 @@ -3446,7 +3446,7 @@

        双端队列 double-ended queue,简称Deque } else if (deque->front > 0) { deque->arr[--deque->front] = data; } else { - printf("Deque is full (front).\n"); + printf("Deque is full (front).\n"); } } @@ -3459,7 +3459,7 @@

        双端队列 double-ended queue,简称Deque } else if (deque->rear < MAX_SIZE - 1) { deque->arr[++deque->rear] = data; } else { - printf("Deque is full (rear).\n"); + printf("Deque is full (rear).\n"); } } @@ -3473,7 +3473,7 @@

        双端队列 double-ended queue,简称Deque deque->front++; } } else { - printf("Deque is empty (front).\n"); + printf("Deque is empty (front).\n"); } } @@ -3487,7 +3487,7 @@

        双端队列 double-ended queue,简称Deque deque->rear--; } } else { - printf("Deque is empty (rear).\n"); + printf("Deque is empty (rear).\n"); } } @@ -3499,16 +3499,16 @@

        双端队列 double-ended queue,简称Deque// 打印双端队列中的元素 void printDeque(struct Deque* deque) { if (isEmpty(deque)) { - printf("Deque is empty.\n"); + printf("Deque is empty.\n"); return; } - printf("Front: %d, Rear: %d\n", deque->front, deque->rear); - printf("Elements: "); + printf("Front: %d, Rear: %d\n", deque->front, deque->rear); + printf("Elements: "); for (int i = deque->front; i <= deque->rear; i++) { - printf("%d ", deque->arr[i]); + printf("%d ", deque->arr[i]); } - printf("\n"); + printf("\n"); } // 主函数 @@ -3678,7 +3678,7 @@

        循环队列

        // 出队操作 int dequeue(struct CircularQueue* queue) { if (queue->front == NULL) { - printf("Queue is empty.\n"); + printf("Queue is empty.\n"); return -1; // 队列为空时返回-1 } int data = queue->front->data; @@ -3703,14 +3703,14 @@

        循环队列

        void printCircularQueue(struct CircularQueue* queue) { struct Node* current = queue->front; if (current == NULL) { - printf("Circular Queue is empty.\n"); + printf("Circular Queue is empty.\n"); return; } do { - printf("%d ", current->data); + printf("%d ", current->data); current = current->next; } while (current != queue->front); - printf("\n"); + printf("\n"); } // 主函数 @@ -3865,7 +3865,7 @@

        循环队列

        // 入队操作 void enqueue(struct CircularQueue* queue, int data) { if ((queue->rear + 1) % MAX_SIZE == queue->front) { - printf("Queue is full.\n"); + printf("Queue is full.\n"); return; } if (queue->front == -1) { @@ -3881,7 +3881,7 @@

        循环队列

        // 出队操作 int dequeue(struct CircularQueue* queue) { if (queue->front == -1) { - printf("Queue is empty.\n"); + printf("Queue is empty.\n"); return -1; } int data = queue->arr[queue->front]; @@ -3902,16 +3902,16 @@

        循环队列

        // 打印循循环队列中的元素 void printCircularQueue(struct CircularQueue* queue) { if (isEmpty(queue)) { - printf("Circular Queue is empty.\n"); + printf("Circular Queue is empty.\n"); return; } int i = queue->front; do { - printf("%d ", queue->arr[i]); + printf("%d ", queue->arr[i]); i = (i + 1) % MAX_SIZE; } while (i != (queue->rear + 1) % MAX_SIZE); - printf("\n"); + printf("\n"); } // 主函数 @@ -4031,16 +4031,16 @@

        双向循环链表

        // 打印双向循环链表的元素 void printDoublyCircularLinkedList(struct Node* head) { if (head == NULL) { - printf("Empty Doubly Circular Linked List\n"); + printf("Empty Doubly Circular Linked List\n"); return; } struct Node* current = head; do { - printf("%d ", current->data); + printf("%d ", current->data); current = current->next; } while (current != head); - printf("\n"); + printf("\n"); } // 主函数 @@ -4050,7 +4050,7 @@

        双向循环链表

        insertAtEnd(&head, 2); insertAtEnd(&head, 3); - printf("Doubly Circular Linked List: ");c + printf("Doubly Circular Linked List: ");c printDoublyCircularLinkedList(head); return 0; @@ -4077,7 +4077,7 @@

        双向循环链表

        make_tree(tree,a,n,p*2+1,i); }

        -

        直接找到越界为止

        +

        直接找到越界为止

        diff --git "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/mynotes/midterm/index.html" "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/mynotes/midterm/index.html" index 4d9286cf..6633e6f2 100644 --- "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/mynotes/midterm/index.html" +++ "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/mynotes/midterm/index.html" @@ -2622,7 +2622,7 @@ -

        midterm

        +

        midterm

        易错复杂度分析

        建堆(不是一个个插入)的算法:\(O(N)\),对i=n/2到1的所有节点都pecolate down

        指针比较多,注意调试不要打印或者访问NULL的某个属性,避免越界等段错误

        @@ -2820,7 +2820,7 @@

        path-compression akaman-algorithm

        4.树:二叉树,搜索树

        zigzagging on a tree

        -

        zigzag.jpg

        +

        zigzag.jpg

        C
        1
         2
         3
        @@ -3049,7 +3049,7 @@ 

        zigzagging on a tree

        void print_tree(tree_ptr tree){ //打印顺序为根左右 if(tree == NULL)return; - printf("%d ", tree->data); + printf("%d ", tree->data); if(tree->left != NULL)print_tree(tree->left); if(tree->right != NULL)print_tree(tree->right); } @@ -3073,7 +3073,7 @@

        zigzagging on a tree

        { for (int i = queue->front; i < queue->front + len; i++) { - printf(" %d", queue->list[i]->data); + printf(" %d", queue->list[i]->data); } } else @@ -3081,9 +3081,9 @@

        zigzagging on a tree

        for (int i = queue->front + len - 1; i >= queue->front; i--) { if (level == 0) - printf("%d", queue->list[i]->data); + printf("%d", queue->list[i]->data); else - printf(" %d", queue->list[i]->data); + printf(" %d", queue->list[i]->data); } } for (int i = queue->front; i < queue->front + len; i++) @@ -3102,7 +3102,7 @@

        zigzagging on a tree

        { // zigzag 层序遍历,在每一行输出时打印出逆序的 int n; - scanf("%d", &n); + scanf("%d", &n); // The second line gives the inorder sequence // and the third line gives the postorder sequence /* 1. 根据后序序列的最后一个元素建立根结点; @@ -3113,9 +3113,9 @@

        zigzagging on a tree

        int in_order[MAX_NODE_NUM] = {0}; int post_order[MAX_NODE_NUM] = {0}; for (int i = 0; i < n; i++) - scanf("%d", &in_order[i]); + scanf("%d", &in_order[i]); for (int i = 0; i < n; i++) - scanf("%d", &post_order[i]); + scanf("%d", &post_order[i]); tree_ptr tree = build_tree(in_order, post_order, n); // 把树打印出来看看 @@ -3156,7 +3156,7 @@

        zigzagging on a tree

        }

        insertion sequence序列不同,构建出的二叉树形状可能有多种

        -

        2023-11-23 (9)

        +

        2023-11-23 (9)

        建立二叉搜索树的顺序

        先判断当前节点是否为NULL,若是,则建立新节点(data = x,left=right=NULL)

        若不是,则递归向下,若大于当前,则Insert(x,tree->left),小于前,则Insert(x,tree->right)

        @@ -3187,7 +3187,7 @@

        zigzagging on a tree

        { T = malloc( sizeof( struct TreeNode ) ); if ( T == NULL ) - FatalError( "Out of space!!!" ); + FatalError( "Out of space!!!" ); else { T->Element = X; @@ -3200,13 +3200,13 @@

        zigzagging on a tree

        else if ( X > T->Element ) T->Right = Insert( X, T->Right ); - /* Else X is in the tree already; we'll do nothing */ + /* Else X is in the tree already; we'll do nothing */ return T; /* Do not forget this line!! */ }

        作业错题

        -

        2023-11-23 (3)

        -

        2023-11-23 (4)

        +

        2023-11-23 (3)

        +

        2023-11-23 (4)

        环形队列 数组实现

        Suppose that an array of size m is used to store a circular queue. If the front position is front and the current size is size, then the rear element must be at:

        Text Only
        A.front+size
        @@ -3217,10 +3217,10 @@ 

        zigzagging on a tree

        Text Only
        D.front+size-1
         
        -

        2023-11-23 (5)

        -

        image-20231123171418423

        +

        2023-11-23 (5)

        +

        image-20231123171418423

        disjoint sets

        -

        2023-11-23 (7)

        +

        2023-11-23 (7)

        HW3: 栈最多容纳M个数,数字1~N依次入栈,而出栈顺序任意,验证给定的序列是否为出栈序列

        对于某个序列,如3,2,1,7,5,6,4,栈的大小为5

        预设flag=1,假设是合法出栈序列

        @@ -3288,7 +3288,7 @@
        HW3: 栈最多容纳M个数,数字1~N依次入栈,而出栈 int main() { int M, N, K; - scanf("%d %d %d", &M, &N, &K); + scanf("%d %d %d", &M, &N, &K); // M为栈的最大容量,N为入栈的数字个数,K为需要判断的出栈序列的个数 int i, j, k; int num[MAXSIZE]; @@ -3298,13 +3298,13 @@
        HW3: 栈最多容纳M个数,数字1~N依次入栈,而出栈 { for (j = 0; j < N; j++) { - scanf("%d", &num[j]); + scanf("%d", &num[j]); } flag = test(num, M, N); // 传入出栈序列,栈的最大容量,入栈数字的个数 if (flag == 0) - printf("NO\n"); + printf("NO\n"); else - printf("YES\n"); + printf("YES\n"); } } @@ -3336,7 +3336,7 @@
        HW3: 栈最多容纳M个数,数字1~N依次入栈,而出栈

        polish

        infix操作

        -

        2023-11-26

        +

        2023-11-26

        C

        计算机只能在将中缀表达式转换为前缀或后缀表达式后才能进行运算

        计算机在计算后缀表达式时只需从左到右线性扫描,遇到操作数压入栈,遇到运算符则依次取出栈顶的两个操作数计算后将结果重新压回栈中。

        @@ -3345,12 +3345,12 @@
        HW3: 栈最多容纳M个数,数字1~N依次入栈,而出栈

        最后输出时一般是倒序输出

        注意,只有S1栈顶运算符优先级小于当前运算符时,才将当前运算符压入S1,否则直接压入中间结果栈S2

        S2不叫操作数栈,因为最后结果从S2中逆序输出得到

        -

        img

        -

        img

        +

        img

        +

        img

        倒序输出为ABC+*DEF+/-

        操作数顺序不会变化,一定是叶子节点

        二分查找+1-1问题处理

        -

        img

        +

        img

        • 左、中、右索引的分配。
        • 循环或递归终止条件。
        • @@ -3445,9 +3445,9 @@

          15-16

          int X; T = BuildTree(); - scanf("%d", &X); + scanf("%d", &X); Print_NGT( T, X ); - printf("End\n"); + printf("End\n"); return 0; } @@ -3456,7 +3456,7 @@

          15-16

          void Print_NGT( Tree T, int X ){ } -
        +
        diff --git "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK01/index.html" "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK01/index.html" index b870c146..d172503c 100644 --- "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK01/index.html" +++ "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK01/index.html" @@ -2648,7 +2648,7 @@ -

        WEEK 1

        +

        WEEK 1

        1 Algorithm Analysis

        [Definition] An algorithm is a finite set of instructions that, if followed, accomplishes a particular task. In addition, all algorithms must satisfy the following criteria.

          @@ -2683,7 +2683,7 @@

          Interchange list[i] and list[min]; }

        -
        +

        1.1 What to Analyze

        • @@ -2780,7 +2780,7 @@

          [Example] Recu T_{rsum}(n)=2n+2 \]

        But it takes more time to compute each step.

        -
        +

        1.2 Asymptotic Notation(\(O,\Omega,\Theta,o\))

        • predict the growth ; compare the time complexities of two programs ; asymptotic(渐进的) behavior
        • @@ -2815,8 +2815,8 @@

          [Definition]

          -

          1-2

          +

          1-1

          +

          1-2

          [Example] Matrix addition

          C
           1
            2
          @@ -2860,7 +2860,7 @@ 

          General Rules

          The running time is never more than the running time of the test plus the larger of the running time of S1 and S2.

          -

          1-3

          +

          1-3

          • Recursions :
          @@ -2891,7 +2891,7 @@

          General Rules

          \(O(N)\)

          \(O(N)\)

          -
          \[T(N)\]
          +
          \[T(N)\]
          diff --git "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK02/index.html" "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK02/index.html" index 35c05709..c4b45680 100644 --- "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK02/index.html" +++ "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK02/index.html" @@ -2711,7 +2711,7 @@ -

          WEEK 2

          +

          WEEK 2

          1.3 Compare the Algorithms

          [Example] 最大子序列和

          Algorithm 1

          @@ -2904,7 +2904,7 @@

          [Example] 最大子序列和

        • A[ ] is scanned once only. 扫描一次,无需存储(处理streaming data)
        • 在任意时刻,算法都能对它已经读入的数据给出子序列问题的正确答案(其他算法不具有这个特性)
        • -
          +

          1.4 Logrithms in the Running Time

          • 如果一个算法用常数时间将问题的大小削减为其一部分(通常是1/2),那么该算法就是\(O(logN)\)
          • @@ -2985,7 +2985,7 @@

            [Example] Efficient exponentiation

            else return Pow(X*X, N/2)*X; /*return Pow(X, N-1)*X is the same*/ }
          -
          +

          1.5 Checking Your Analysis

          Method 1

          When \(T(N)=O(N)\), check if \(T(2N)/T(N)\approx2\)

          @@ -2993,12 +2993,12 @@

          Method 1

          When \(T(N)=O(N^3)\), check if \(T(2N)/T(N)\approx8\)

          Method 2

          When \(T(N)=O(f(N))\), check if $\lim\limits_{N\rightarrow\infty}\frac{T(N)}{f(N)}\approx C $

          -
          +

          2 LIst, Stacks and Queues

          2.1 Abstract Data Type(ADT) 抽象数据类型

          [Definition] Data Type = {Objects} and {Operations}

          [Definition] An Abstract Data Type(ADT) is a data type that is organized in such a way that the specification on the objects and specification of the operations on the objects are separated from the representation of the objects and the implementation on the operations.

          -
          +

          2.2 The List ADT

          • Objects : N items
          • @@ -3027,7 +3027,7 @@

            Simple Array implementation of Lis

            Insertion and Deletion not only take \(O(N)\) times, but also involve a lot of data movements which takes time.

          -

          2-3

          +

          2-3

          Query 查询

          Linked Lists

            @@ -3162,7 +3162,7 @@

            Linked Lists

            Position TmpCell; TmpCell = malloc(sizeof(struct Node)); - if (TmpCell == NULL) FatalError("Out of space!") + if (TmpCell == NULL) FatalError("Out of space!") TmpCell->Element = X; TmpeCell->Next = P->Next; @@ -3199,7 +3199,7 @@

            Doubly Linked Circular Lists

            • Finding take \(O(\frac N 2)\) times.
            -

            2-1

            +

            2-1

            The correct answer is D.

            Two Applications

              @@ -3292,7 +3292,7 @@

              Two Applications

              PolyProd->HighPower = Poly1->HighPower + Poly2->HighPower; if(PolyProd->HighPower > MaxDegree) - Error("Exceeded array size"); + Error("Exceeded array size"); else for(i = O; i <= Poly1->HighPower; i++) for(j = O; j <= Poly2->HighPower; j++) @@ -3325,9 +3325,9 @@

              Two Applications

          Cursor Implementation of Linked Lists(no pointer)

          -

          2-2

          -
          -

          #blender エイサー・パルマタム || Acer Palmatum - selescha.arts的插画 - pixiv

          +

          2-2

          +
          +

          #blender エイサー・パルマタム || Acer Palmatum - selescha.arts的插画 - pixiv

        diff --git "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK03/index.html" "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK03/index.html" index 8253df06..bd28de41 100644 --- "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK03/index.html" +++ "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK03/index.html" @@ -2570,7 +2570,7 @@ -

        WEEK 3

        +

        WEEK 3

        1、栈的链表实现,push,pop和top语句

        2、

        2.3 The Stack ADT

        @@ -2589,7 +2589,7 @@

        2.3 The Stack ADT

      3. Push on a full stack is an implementation error but not an ADT error.
      4. Linked List Implementation (with a header node)

        -

        3-1

        +

        3-1

        • The calls to malloc and free are expensive. Simply keep another stack as a recycle bin.
        @@ -2623,7 +2623,7 @@

        Linked List Implementatio Stack S; S = malloc(sizeof(struct Node)); if (S == NULL) - Fatal Error("Out of space!"); + Fatal Error("Out of space!"); S->Next == NULL; MakeEmpty(S); return S; @@ -2632,7 +2632,7 @@

        Linked List Implementatio void MakeEmpty(Stack S) { if (S == NULL) - Error("Must use CreateStack first"); + Error("Must use CreateStack first"); else while(!IsEmpty(S)) Pop(S); } @@ -2654,7 +2654,7 @@

        Linked List Implementatio PtrToNode TmpCell; TmpCell = malloc(sizeof(struct Node)); if (TmpCell == NULL) - Fatal Error("Out of space!") ; + Fatal Error("Out of space!") ; else { TmpCell->Element = X; @@ -2673,7 +2673,7 @@

        Linked List Implementatio { if(!IsEmpty(S)) return S->Next->Element; - Error("Empty stack") ; + Error("Empty stack") ; return O; /* Return value used to avoid warning*/ }

        @@ -2692,7 +2692,7 @@

        Linked List Implementatio { PtrToNode FirstCell; if(IsEmpty(S)) - Error("Empty stack") ; + Error("Empty stack") ; else { FirstCe11 = S->Next; @@ -2741,14 +2741,14 @@

        Array Implementation of Stacks

        { Stack S; if(MaxElements < MinStackSize) - Error("Stack size is too small") ; + Error("Stack size is too small") ; S = malloc(sizeof(struct StackRecord)); if (S == NULL) - Fatal Error("Out of space!!!") ; + Fatal Error("Out of space!!!") ; S->Array = malloc(sizeof(ElementType) * MaxElements) ; if(S->Array = NULL) - Fatal Error("Out of space!!!"); + Fatal Error("Out of space!!!"); S->Capacity = MaxElements; MakeEmpty(S) ; return S; @@ -2795,7 +2795,7 @@

        Array Implementation of Stacks

        7

        void Push(ElementType X, Stack S)
         {
           if (IsFull(S))
        -      Error("Full stack");
        +      Error("Full stack");
           else
               S->Array[ ++S->TopOfStack ] = X;
         }
        @@ -2810,7 +2810,7 @@ 

        Array Implementation of Stacks

        { if(! IsEmpty(S)) return S->Array[ S->TopOfStack ]; - Error("Empty stack") ; + Error("Empty stack") ; return O; /* Return value used to avoid warning*/ }
        @@ -2823,7 +2823,7 @@

        Array Implementation of Stacks

        7
        void Pop(Stack S)
         {
           if(IsEmpty(S))
        -      Error("Empty stack") ;
        +      Error("Empty stack") ;
           else
               S->TopOfStack--;
         }
        @@ -2838,7 +2838,7 @@ 

        Array Implementation of Stacks

        { if(!Is Empty(S)) return S->Array[ S->TopOfStack-- ]; - Error("Empty stack"); + Error("Empty stack"); return O; /* Return value used to avoid warnin */ }
        @@ -2897,13 +2897,13 @@

        Application

      5. Function Calls (System Stack)

        -

        3-2

        +

        3-2

        Note : Recursion can always be completely removed. Non recursive programs are generally faster than equivalent recursive programs. However, recursive programs are in general much simpler and easier to understand.

      -
      +

      2.4 The Queue ADT

    -

    5-1

    +

    5-1

    The correct answer is A.

    -
    +
    diff --git "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK06/index.html" "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK06/index.html" index c14ab788..1b797db9 100644 --- "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK06/index.html" +++ "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK06/index.html" @@ -2681,7 +2681,7 @@ -

    WEEK 6

    +

    WEEK 6

    4 堆 Priority Queues (Heaps)

    4.1 ADT Model

      @@ -2692,7 +2692,7 @@

      4.1 ADT Model

    • ElementType DeleteMin( PriorityQueue H );
    • ElementType FindMin( PriorityQueue H );
    -
    +

    4.2 Implementations

    Array

      @@ -2740,7 +2740,7 @@

      Binary Search Tree

    • Keep a balanced tree
    • But there are many operations related to AVL tree that we don't really need for a priority queue.
    -
    +

    4.3 Binary Heap

    Structure Property

    [Definition] A binary tree with \(n\) nodes and height \(h\) is complete if its nodes correspond to the nodes numbered from \(1\) to \(n\) in the perfect binary tree of height \(h\).

    @@ -2755,7 +2755,7 @@

    Structure Property

    Array Representation : BT[n + 1] ( BT[0] is not used)

    -

    6-1

    +

    6-1

    [Lemma]

    1. \(index\,of\,parent(i)=\left\{ @@ -2794,14 +2794,14 @@

      Structure Property

      { PriorityQueue H; if ( MaxElements < MinPQSize ) - return Error( "Priority queue size is too small" ); + return Error( "Priority queue size is too small" ); H = malloc(sizeof( struct HeapStruct )); if ( H == NULL ) - return FatalError( "Out of space!!!" ); + return FatalError( "Out of space!!!" ); /* Allocate the array plus one extra for sentinel */ H->Elements = malloc(( MaxElements + 1 ) * sizeof( ElementType )); if ( H->Elements == NULL ) - return FatalError( "Out of space!!!" ); + return FatalError( "Out of space!!!" ); H->Capacity = MaxElements; H->Size = 0; H->Elements[0] = MinData; /* set the sentinel */ @@ -2835,7 +2835,7 @@

      Basic Heap Operations

      int i; if ( IsFull( H )) { - Error( "Priority queue is full" ); + Error( "Priority queue is full" ); return; } for ( i = ++H->Size; H->Elements[ i/2 ] > X; i /= 2 ) @@ -2849,7 +2849,7 @@

      Basic Heap Operations

      1. DeleteMin
      -

      C
       1
      +

      C
       1
        2
        3
        4
      @@ -2878,7 +2878,7 @@ 

      Basic Heap Operations

      ElementType MinElement, LastElement; if ( IsEmpty( H ) ) { - Error( "Priority queue is empty" ); + Error( "Priority queue is empty" ); return H->Elements[ 0 ]; } MinElement = H->Elements[ 1 ]; /*Save the min element*/ @@ -2899,7 +2899,7 @@

      Basic Heap Operations

      $$ T(N)=O(\log N) -$$

      +$$

      Other Heap Operations

      • @@ -2927,8 +2927,8 @@

        Other Heap Operations

        T(N)=O(N) $$

        [Theorem] For the perfect binary tree of height \(h\) containing \(2^{h+1}-1\) nodes, the sum of the heights of the nodes is \(2^{h+1}-1-(h+1)\).

        -

        image-20210125151728720

        -
        +

        image-20210125151728720

        +

        4.4 Applications of Priority Queues

        Heap Sort

        查找一个序列中第k小的元素

        @@ -2981,7 +2981,7 @@

        查找一个序列中第k小的元素

        return H[1]; }
      -
      +

      4.5 \(d\)-Heaps — All nodes have \(d\) children

      Note :

      @@ -2991,10 +2991,10 @@

      4.5 \(d\)
    2. When the priority queue is too large to fit entirely in main memory, a d-heap will become interesting.
    3. -

      6-2

      -

      image-20210125070700824

      +

      6-2

      +

      image-20210125070700824

      正确答案是4,注意“in the process”

      -
      +
    diff --git "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK07/index.html" "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK07/index.html" index 64a9e9e9..3f075885 100644 --- "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK07/index.html" +++ "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK07/index.html" @@ -2702,7 +2702,7 @@ -

    WEEK 7

    +

    WEEK 7

    5 The Disjoint Set

    5.1 Equivalence Relations

    @@ -2718,8 +2718,8 @@

    -
    +

    img

    +

    5.2 The Dynamic Equivalence Problem

    • Given an equivalence relation ~, decide for any a and b if a ~ b
    • @@ -2767,7 +2767,7 @@

      5.2 The Dynamic Equivalence Problem<
    • Find( \(i\) ) = Find the set \(S_k\) which contains the element \(i\)
    -
    +

    5.3 Basic Data Structure

    Union( \(i, j\) )

      @@ -2778,7 +2778,7 @@

      Union( \(i, j\) )

      Implementation 1 :

    -

    7-1

    +

    7-1

    • Implementation 2 :

      @@ -2806,7 +2806,7 @@

      Find( \(i\) )

      • Implementation 1 :
      -

      7-2

      +

      7-2

      • Implementation 2 :
      @@ -2824,7 +2824,7 @@

      Analysis

      • Union and find are always paired. Thus we consider the performance of a sequence of union-find operations.
      -

      7-3

      +

      7-3

      Text Only
      1
       2
       3
      @@ -2846,7 +2846,7 @@ 

      Analysis

      • Worst case : \(T(N)=\Theta(N^2)\)
      -
      +

      5.4 Smart Union Algorithms

      Union-by-Size

        @@ -2921,7 +2921,7 @@

        Union-by-Height

        } }
      -
      +

      5.5 Path Compression

      • 从X到Root的路径上的每一个结点都使它的父结点变成Root
      • @@ -2965,7 +2965,7 @@

        5.5 Path Compression

        • Note : Not compatible with union-by-height since it changes the heights. Just take “height” as an estimated rank.
        -
        +

        5.6 Worst Case for Union-by-Rank and Path Compression

        [Lemma] Let \(T(M,N)\) be the maximum time required to process an intermixed sequence of \(M\geq N\) finds and \(N-1\) unions, then \(k_1M\alpha(M,N)\leq T(M,N)\leq k_2M\alpha(M,N)\) for some positive constants \(k_1\) and \(k_2\).

          @@ -2986,7 +2986,7 @@

          \(\alpha(M,N)=min\{i\geq1|A(i,\lfloor M/N\rfloor)>\log N\}\leq O(\log^*N)\leq4\)

        \(\log^*N\) (inverse Ackermann function) = number of times the logarithm is applied to \(N\) until the result \(\leq1\).

        -
        +

        要求时间复杂度证明

        5.7 Conclusion

        一共有五种算法,注意看清题设

        @@ -3007,7 +3007,7 @@

        5.7 Conclusion

        Union-by-height + Path Compression

      -
      +
    diff --git "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK08/index.html" "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK08/index.html" index 2c5cfb70..c19d0f5d 100644 --- "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK08/index.html" +++ "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK08/index.html" @@ -2780,7 +2780,7 @@ -

    WEEK 8

    +

    WEEK 8

    6 Graph Algorithms

    6.1 Definitions

      @@ -2791,7 +2791,7 @@

      Undirected graph

    • \(( v_i , v_j ) = ( v_j , v_i )\) = the same edge.

    Directed graph(diagraph)

    -

    8-1

    +

    8-1

    Restrictions

    • Self loop is illegal.
    • @@ -2801,10 +2801,10 @@

      Complete graph

      • A graph that has the maximum number of edges.
      -

      image-20210124163038265

      +

      image-20210124163038265

      Adjacent

      -

      image-20210124163324744

      -

      image-20210124163301833

      +

      image-20210124163324744

      +

      image-20210124163301833

      Subgraph

      \[ G'\subset G=V(G')\subseteq V(G) \&\& E(G')\subseteq E(G) @@ -2866,14 +2866,14 @@

      Degree

      $$

    -
    +

    6.2 Representation of Graphs

    Adjacency Matrix

    -

    image-20210124163641976

    +

    image-20210124163641976

    Note : If G is undirected, then adj_mat[][] is symmetric. Thus we can save space by storing only half of the matrix.

    -

    image-20210123194735917

    +

    image-20210123194735917

    • This representation wastes space if the graph has a lot of vertices but very few edges.

      @@ -2886,7 +2886,7 @@

      Adjacency Lists

      • Replace each row by a linked list
      -

      image-20210124164723362

      +

      image-20210124164723362

      Note : The order of nodes in each list does not matter.

      @@ -2895,9 +2895,9 @@

      Adjacency Lists

    • Degree(i) = number of nodes in graph[i](if \(G\) is undirected)
    • \(T\) of examine \(E(G)\) = \(O(n+e)\)
    -

    image-20210124165346405

    +

    image-20210124165346405

    Adjacency Multilists

    -

    image-20210124164607434

    +

    image-20210124164607434

    • Sometimes we need to mark the edge after examine it, and then find the next edge.
    @@ -2906,7 +2906,7 @@

    Weighted Edges

  • adj_mat [ i ] [ j ] = weight
  • adjacency lists / multilists : add a weight field to the node
  • -
    +

    6.3 Topological Sort 拓扑排序 不是一种严格意义的排序算法

    AOV activity on vertices Network 有向无环图

      @@ -3010,8 +3010,8 @@

      \[ T=O(|V|+|E|) \]

    -
    -

    \(注意E的范围 最小 V 最大 |V|^2\)

    +
    +

    \(注意E的范围 最小 V 最大 |V|^2\)

    diff --git "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK09/index.html" "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK09/index.html" index 12819298..e552e136 100644 --- "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK09/index.html" +++ "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK09/index.html" @@ -2660,7 +2660,7 @@ -

    WEEK 9

    +

    WEEK 9

    6.4 Shortest Path Algorithms

    Given a digraph \(G = ( V, E )\), and a cost function \(c( e )\) for \(e \in E( G )\).

    The length of a path \(P\) from source to destination is \(\sum_{e_i\subset P} c(e_i)\)(also called weighted path length).

    @@ -2718,7 +2718,7 @@
    Unweighted Shortest Path
    }

    The worst case :

    -

    9-1 +

    9-1 $$ T(N)=O(|V|^2) $$ @@ -2841,9 +2841,9 @@

    Dijkstra’s Algorithm
    if (T[ V ].Path != NotAVertex) { PrintPath(T[ V ].Path, T); - printf(" to") ; + printf(" to") ; } - printf("%v", V) ; /* %v is pseudocode * / + printf("%v", V) ; /* %v is pseudocode * /
    C
     1
      2
    @@ -2971,9 +2971,9 @@ 
    Acyclic Graphs
  • \(T=O(|E|+|V|)\) and no priority queue is needed.
  • AOE(Activity on Edge) Networks
    -

    image-20210124185420522

    -

    image-20210124185541801

    -

    image-20210124185508683

    +

    image-20210124185420522

    +

    image-20210124185541801

    +

    image-20210124185508683

    All-Pairs Shortest Path Problem

    • For all pairs of \(v_i\) and \(v_j\) ( \(i\neq j\) ), find the shortest path between.
    • @@ -2988,7 +2988,7 @@
      Method 2
    • 动态规划
    • \(O(|V|^3)\) algorithm given in Chapter 10, works faster on dense graphs.
    -
    +
    diff --git "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK10/index.html" "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK10/index.html" index 99519bc0..8750a4de 100644 --- "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK10/index.html" +++ "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK10/index.html" @@ -2594,9 +2594,9 @@ -

    WEEK 10

    +

    WEEK 10

    6.5 Network Flow Problems

    -

    image-20201206175230349

    +

    image-20201206175230349

    • Determine the maximum amount of flow that can pass from \(s\) to \(t\).
    @@ -2668,7 +2668,7 @@

    Analysis

  • The min-cost flow problem is to find, among all maximum flows, the one flow of minimum cost provided that each edge has a cost per unit of flow.
  • -
    +

    6.6 Minimum Spanning Tree

    [Definition] A spanning tree of a graph \(G\) is a tree which consists of \(V(G)\) and a subset of \(E(G)\)
    @@ -2792,10 +2792,10 @@
    Greedy Method

    $$ T=O(|E|\log|E|) $$

    -

    image-20210124214008496

    -
    +

    image-20210124214008496

    +
    - +
    diff --git "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK11/index.html" "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK11/index.html" index 912ff0a0..6a333209 100644 --- "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK11/index.html" +++ "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK11/index.html" @@ -2645,7 +2645,7 @@ -

    WEEK 11

    +

    WEEK 11

    C
    1
     2
    @@ -2676,7 +2676,7 @@ 

    Undirected Graphs

    if ( !visited[ V ] ) { DFS( V ); - printf("\n"); + printf("\n"); } }
    @@ -2686,8 +2686,8 @@

    Biconnectivity

  • \(G\) is a biconnected graph if \(G\) is connected and has no articulation points.
  • A biconnected component is a maximal biconnected subgraph.
  • -

    image-20201207194401819

    -

    image-20201207194413257

    +

    image-20201207194401819

    +

    image-20201207194413257

    Note : No edges can be shared by two or more biconnected components. Hence \(E(G)\) is partitioned by the biconnected components of \(G\).

    @@ -2696,8 +2696,8 @@

    Biconnectivity

    • Use depth first search to obtain a spanning tree of \(G\)
    -

    image-20201208110403641

    -

    image-20201208110506092

    +

    image-20201208110403641

    +

    image-20201208110506092

    • Depth first number(\(Num\)) 先序编号
    • Back edges(背向边) = \((u,v)\notin\) tree and \(u\) is an ancestor of \(v\).
    • @@ -2772,7 +2772,7 @@

      Biconnectivity

      { Assignlow(W); if(Low[W] >= Num[V]) - printf("%v is an articulation point\n", v); + printf("%v is an articulation point\n", v); Low[V] = Min(Low[V], Low[W]); /*Rule 3*/ } else @@ -2812,7 +2812,7 @@

      Biconnectivity

      Parent[W] = V; FindArt(W); if(Low[W] >= Num[V]) - printf("%v is an articulation point\n", v); + printf("%v is an articulation point\n", v); Low[V] = Min(Low[V], Low[W]); /*Rule 3*/ } else @@ -2832,7 +2832,7 @@
      \(T=O(|E|+|V|)\)
    -
    +

    7 Sorting

    7.1 Preliminaries

    C
    void X_Sort (ElementType A[], int N)
    @@ -2843,7 +2843,7 @@ 

    7.1 Preliminaries

  • ‘>’ and ‘<’ operators exist and are the only operations allowed on the input data.
  • Consider internal sorting only. The entire sort can be done in main memory.
  • -
    +

    7.2 Insertion Sort

    C
     1
      2
    @@ -2887,7 +2887,7 @@ 

    7.2 Insertion Sort

    $$

    -
    +

    7.3 A Lower Bound for Simple Sorting Algorithms

    [Definition] An inversion in an array of numbers is any ordered pair\((i,j)\) having the property that \(i<j\) but \(A[i]>A[j]\)

      @@ -2900,7 +2900,7 @@

      [Theorem] The average number of inversions in an array of \(N\) distinct numbers is \(N(N-1)/4\)

      [Theorem] Any algorithm that sorts by exchanging adjacent elements requires \(\Omega(N^2)\) time on average

      -
      +
    diff --git "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK12/index.html" "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK12/index.html" index 9651d505..456ff0c2 100644 --- "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK12/index.html" +++ "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK12/index.html" @@ -2612,9 +2612,9 @@ -

    WEEK 12

    +

    WEEK 12

    7.4 Shellsort

    -

    image-20201214133747061

    +

    image-20201214133747061

    • Define an increment sequence \(h_1 < h_2 < \cdots < h_t ( h_1 = 1 )\)
    • @@ -2684,7 +2684,7 @@

      Conclusion

    • Shellsort is a very simple algorithm, yet with an extremely complex analysis.
    • It is good for sorting up to moderately large input (tens of thousands).
    -
    +

    7.5 Heapsort

    Algorithm1

    C
    1
    @@ -2738,7 +2738,7 @@ 

    Algorithm2

    Note : Although Heapsort gives the best average time, in practice it is slower than a version of Shellsort that uses Sedgewick’s increment sequence.

    -
    +

    7.6 Mergesort

    C
     1
      2
    @@ -2783,7 +2783,7 @@ 

    7.6 Mergesort

    MSort(A, TmpArray, 0, N-1); free(TmpArray); } - else FatalError("No space for tmp array!!!"); + else FatalError("No space for tmp array!!!"); }
      @@ -2841,7 +2841,7 @@

      Analysis

      Note : Mergesort requires linear extra memory, and copying an array is slow. It is hardly ever used for internal sorting, but is quite useful for external sorting.

      -
      +
    diff --git "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK13/index.html" "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK13/index.html" index 22dcff20..434672a5 100644 --- "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK13/index.html" +++ "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK13/index.html" @@ -2681,7 +2681,7 @@ -

    WEEK 13

    +

    WEEK 13

    7.7 Quicksort

    • the fastest known sorting algorithm in practice
    • @@ -2993,16 +2993,16 @@

      Quickselect

      InsertionSort(A+Left, Right-Left+1); }
    -

    image-20210125115951471

    +

    image-20210125115951471

    正确答案是D

    -
    +

    7.8 Sorting Large Structures

    • Swapping large structures can be very much expensive.
    • Add a pointer field to the structure and swap pointers instead – indirect sorting. Physically rearrange the structures at last if it is really necessary.
    • Table Sort
    -
    +

    7.9 A General Lower Bound for Sorting

    [Theorem] Any algorithm that sorts by comparisons only must have a worst case computing time of \(\Omega(N\log N)\).

      @@ -3012,9 +3012,9 @@

      \(N!\geq (N/2)^{N/2}\) and \(\log_2N!\geq(N/2)\log_2(N/2) = \Theta(N\log_2N )\)
    • Therefore \(T(N)=k\geq c\cdot N\log_2 N\)
    -
    +

    7.10 Bucket Sort

    -

    image-20201221203533117

    +

    image-20201221203533117

    Text Only
     1
      2
      3
    @@ -3038,23 +3038,23 @@ 

    7.10 Bucket Sort

    \[ T(N,M)=O(M+N) \]
    -
    +

    7.11 Radix Sort

    -

    image-20201221203826847

    -

    image-20201221203950519

    +

    image-20201221203826847

    +

    image-20201221203950519

    • \(T=O(P(N+B))\) where \(P\) is the number of passes, \(N\) is the number of elements to sort, and \(B\) is the number of buckets.

    MSD(Most Significant Digit) Sort and LSD(Least Significant Digit) Sort

    -

    image-20210102211456822

    -

    image-20210102211604977

    -

    image-20210102211647809

    -
    +

    image-20210102211456822

    +

    image-20210102211604977

    +

    image-20210102211647809

    +
    • 稳定的排序算法:冒泡排序、插入排序、归并排序、基数排序
    • 不稳定的排序算法:选择排序、快速排序、希尔排序、堆排序
    -
    +
    diff --git "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK14/index.html" "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK14/index.html" index 1ca65f56..45bba1e0 100644 --- "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK14/index.html" +++ "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK14/index.html" @@ -2627,10 +2627,10 @@ -

    WEEK 14

    +

    WEEK 14

    8 Hashing

    8.1 General Idea

    -

    image-20210102212103035

    +

    image-20210102212103035

    Symbol Table ADT

    • Objects : A set of name-attribute pairs, where the names are unique
    • @@ -2642,18 +2642,18 @@

      Symbol Table ADT

    • SymTab Delete(symtab, name)

    Hash Tables

    -

    image-20210102212608844

    +

    image-20210102212608844

    • A collision occurs when we hash two nonidentical identifiers into the same bucket.
    • An overflow occurs when we hash a new identifier into a full bucket.
    -
    +

    8.2 Hash Function

    • \(f(x)\) must be easy to compute and minimize the number of collisions.
    • \(f(x)\) should be unbiased. For any \(x\) and any \(i\), we have that \(Probability(f(x)=i)=\frac{1}{b}\). Such kind of a hash function is called a uniform hash function.
    -
    +

    8.3 Separate Chaining

    • keep a list of all keys that hash to the same value
    • @@ -2719,19 +2719,19 @@

      Create an empty table

      int i; if ( TableSize < MinTableSize ) { - Error( "Table size too small" ); + Error( "Table size too small" ); return NULL; } H = malloc( sizeof( struct HashTbl ) ); /*Allocate table*/ - if ( H == NULL ) FatalError( "Out of space!!!" ); + if ( H == NULL ) FatalError( "Out of space!!!" ); H->TableSize = NextPrime( TableSize ); /*Better be prime*/ H->TheLists = malloc( sizeof( List )* H->TableSize ); /*Array of lists*/ - if ( H->TheLists == NULL ) FatalError( "Out of space!!!" ); + if ( H->TheLists == NULL ) FatalError( "Out of space!!!" ); H->TheList = malloc(H->TableSize*sizeof(struct ListNode)); for( i = 0; i < H->TableSize; i++ ) { /*Allocate list headers*/ //H->TheLists[ i ] = malloc( sizeof( struct ListNode ) ); /* Slow! */ - if ( H->TheLists[ i ] == NULL ) FatalError( "Out of space!!!" ); + if ( H->TheLists[ i ] == NULL ) FatalError( "Out of space!!!" ); else H->TheLists[ i ]->Next = NULL; } return H; @@ -2784,7 +2784,7 @@

      Insert a key into a hash table

      if ( Pos == NULL ) { /*Key is not found, then insert*/ NewCell = malloc( sizeof( struct ListNode ) ); - if ( NewCell == NULL ) FatalError( "Out of space!!!" ); + if ( NewCell == NULL ) FatalError( "Out of space!!!" ); else { L = H->TheLists[ Hash( Key, H->TableSize ) ]; /*Compute again is bad*/ @@ -2798,7 +2798,7 @@

      Insert a key into a hash table

      Note : Make the TableSize about as large as the number of keys expected (i.e. to make the loading density factor \(\lambda\approx\)1).

      -
      +

      8.4 Open Addressing

      • find another empty cell to solve collision(avoiding pointers)
      • @@ -2838,7 +2838,7 @@

        Linear Probing

      • 逐个探测每个单元(必要时可以绕回)以查找出一个空单元
      • 使用线性探测的预期探测次数对于插入和不成功的查找来说大约是\(\frac{1}{2}(1+\frac{1}{(1-\lambda)^2})\),对于成功的查找来说是\(\frac{1}{2}(1+\frac{1}{1-\lambda})\)
      • Cause primary clustering : any key that hashes into the cluster will add to the cluster after several attempts to resolve the collision.
      • -
      +
    diff --git "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK15/index.html" "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK15/index.html" index c4dd0498..30d70499 100644 --- "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK15/index.html" +++ "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/DS WEEK15/index.html" @@ -2546,13 +2546,13 @@ -

    WEEK 15

    +

    WEEK 15

    Quadratic Probing

    • \(F(i)\) is a quadratic function of \(i\), such as \(F(i)=i^2\).
    [Theorem] If quadratic probing is used, and the table size is prime, then a new element can always be inserted if the table is at least half empty.
    -

    image-20210104154133711

    +

    image-20210104154133711

    Note : If the table size is a prime of the form \(4k + 3\), then the quadratic probing \(f(i) = \pm i^2\) can probe the entire table.

    @@ -2585,19 +2585,19 @@
    int i; if(TableSize < MinTableSize) { - Error("Table size too small"); + Error("Table size too small"); return NULL; } /*Allocate table*/ H = malloc(sizeof(struct HashTbl)); if(H == NULL) - Fatal Error("Out of space!!!"); + Fatal Error("Out of space!!!"); H->TableSize = NextPrime(TableSize); /*Allocate array of Cells*/ H->TheCells = malloc(sizeof(Cell)*H->TableSize); if(H->TheCells == NULL) - FatalError("Out of space!!!"); + FatalError("Out of space!!!"); for(i = 0; i < H->TableSize; i++) H->TheCells[ i ].Info = Empty; @@ -2675,7 +2675,7 @@

    Double Hashing

  • Quadratic probing does not require the use of a second hash function and is thus likely to be simpler and faster in practice.
  • -
    +

    8.5 Rehashing

    • Build another table that is about twice as big.
    • @@ -2723,7 +2723,7 @@

      8.5 Rehashing

      return H; }
    -
    +
    diff --git "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/Foundation-of-Data-Structure/index.html" "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/Foundation-of-Data-Structure/index.html" index d86116c5..07e74f38 100644 --- "a/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/Foundation-of-Data-Structure/index.html" +++ "b/site/JY_HU/2 \346\225\260\346\215\256\347\273\223\346\236\204/webnotes/Foundation-of-Data-Structure/index.html" @@ -4553,11 +4553,11 @@ -

    Foundation of Data Structure

    +

    Foundation of Data Structure

    by OE.Heart

    -
    +

    1 Algorithm Analysis

    [Definition] An algorithm is a finite set of instructions that, if followed, accomplishes a particular task. In addition, all algorithms must satisfy the following criteria.

      @@ -4592,7 +4592,7 @@

      Interchange list[i] and list[min]; }

    -
    +

    1.1 What to Analyze

    • @@ -4689,7 +4689,7 @@

      [Example] Recu T_{rsum}(n)=2n+2 \]

    But it takes more time to compute each step.

    -
    +

    1.2 Asymptotic Notation(\(O,\Omega,\Theta,o\))

    • predict the growth ; compare the time complexities of two programs ; asymptotic(渐进的) behavior
    • @@ -4724,8 +4724,8 @@

      [Definition]

      -

      1-2

      +

      1-1

      +

      1-2

      [Example] Matrix addition

      C
       1
        2
      @@ -4769,7 +4769,7 @@ 

      General Rules

      The running time is never more than the running time of the test plus the larger of the running time of S1 and S2.

      -

      1-3

      +

      1-3

      • Recursions :
      @@ -4798,7 +4798,7 @@

      General Rules

      时间复杂度:\(O(2^N)\) \(T(N)\) grows exponentially

      空间复杂度:\(O(N)\)

      -
      +

      1.3 Compare the Algorithms

      [Example] 最大子序列和

      Algorithm 1

      @@ -4991,7 +4991,7 @@

      [Example] 最大子序列和

    • A[ ] is scanned once only. 扫描一次,无需存储(处理streaming data)
    • 在任意时刻,算法都能对它已经读入的数据给出子序列问题的正确答案(其他算法不具有这个特性)
    • -
      +

      1.4 Logrithms in the Running Time

      • 如果一个算法用常数时间将问题的大小削减为其一部分(通常是1/2),那么该算法就是\(O(logN)\)
      • @@ -5072,7 +5072,7 @@

        [Example] Efficient exponentiation

        else return Pow(X*X, N/2)*X; /*return Pow(X, N-1)*X is the same*/ }
      -
      +

      1.5 Checking Your Analysis

      Method 1

      When \(T(N)=O(N)\), check if \(T(2N)/T(N)\approx2\)

      @@ -5080,12 +5080,12 @@

      Method 1

      When \(T(N)=O(N^3)\), check if \(T(2N)/T(N)\approx8\)

      Method 2

      When \(T(N)=O(f(N))\), check if $\lim\limits_{N\rightarrow\infty}\frac{T(N)}{f(N)}\approx C $

      -
      +

      2 LIst, Stacks and Queues

      2.1 Abstract Data Type(ADT) 抽象数据类型

      [Definition] Data Type = {Objects} and {Operations}

      [Definition] An Abstract Data Type(ADT) is a data type that is organized in such a way that the specification on the objects and specification of the operations on the objects are separated from the representation of the objects and the implementation on the operations.

      -
      +

      2.2 The List ADT

      • Objects : N items
      • @@ -5114,7 +5114,7 @@

        Simple Array implementation of Lis

        Insertion and Deletion not only take \(O(N)\) times, but also involve a lot of data movements which takes time.

      -

      2-3

      +

      2-3

      Query 查询

      Linked Lists

        @@ -5249,7 +5249,7 @@

        Linked Lists

        Position TmpCell; TmpCell = malloc(sizeof(struct Node)); - if (TmpCell == NULL) FatalError("Out of space!") + if (TmpCell == NULL) FatalError("Out of space!") TmpCell->Element = X; TmpeCell->Next = P->Next; @@ -5286,7 +5286,7 @@

        Doubly Linked Circular Lists

        • Finding take \(O(\frac N 2)\) times.
        -

        2-1

        +

        2-1

        The correct answer is D.

        Two Applications

          @@ -5381,7 +5381,7 @@

          Two Applications

          PolyProd->HighPower = Poly1->HighPower + Poly2->HighPower; if(PolyProd->HighPower > MaxDegree) - Error("Exceeded array size"); + Error("Exceeded array size"); else for(i = O; i <= Poly1->HighPower; i++) for(j = O; j <= Poly2->HighPower; j++) @@ -5414,8 +5414,8 @@

          Two Applications

      Cursor Implementation of Linked Lists(no pointer)

      -

      2-2

      -
      +

      2-2

      +

      2.3 The Stack ADT

      • Last-In-First-Out (LIFO)
      • @@ -5432,7 +5432,7 @@

        2.3 The Stack ADT

      • Push on a full stack is an implementation error but not an ADT error.

      Linked List Implementation (with a header node)

      -

      3-1

      +

      3-1

      • The calls to malloc and free are expensive. Simply keep another stack as a recycle bin.
      @@ -5466,7 +5466,7 @@

      Linked List Implementatio Stack S; S = malloc(sizeof(struct Node)); if (S == NULL) - Fatal Error("Out of space!"); + Fatal Error("Out of space!"); S->Next == NULL; MakeEmpty(S); return S; @@ -5475,7 +5475,7 @@

      Linked List Implementatio void MakeEmpty(Stack S) { if (S == NULL) - Error("Must use CreateStack first"); + Error("Must use CreateStack first"); else while(!IsEmpty(S)) Pop(S); } @@ -5497,7 +5497,7 @@

      Linked List Implementatio PtrToNode TmpCell; TmpCell = malloc(sizeof(struct Node)); if (TmpCell == NULL) - Fatal Error("Out of space!") ; + Fatal Error("Out of space!") ; else { TmpCell->Element = X; @@ -5516,7 +5516,7 @@

      Linked List Implementatio { if(!IsEmpty(S)) return S->Next->Element; - Error("Empty stack") ; + Error("Empty stack") ; return O; /* Return value used to avoid warning*/ }

    @@ -5535,7 +5535,7 @@

    Linked List Implementatio { PtrToNode FirstCell; if(IsEmpty(S)) - Error("Empty stack") ; + Error("Empty stack") ; else { FirstCe11 = S->Next; @@ -5584,14 +5584,14 @@

    Array Implementation of Stacks

    { Stack S; if(MaxElements < MinStackSize) - Error("Stack size is too small") ; + Error("Stack size is too small") ; S = malloc(sizeof(struct StackRecord)); if (S == NULL) - Fatal Error("Out of space!!!") ; + Fatal Error("Out of space!!!") ; S->Array = malloc(sizeof(ElementType) * MaxElements) ; if(S->Array = NULL) - Fatal Error("Out of space!!!"); + Fatal Error("Out of space!!!"); S->Capacity = MaxElements; MakeEmpty(S) ; return S; @@ -5638,7 +5638,7 @@

    Array Implementation of Stacks

    7

    void Push(ElementType X, Stack S)
     {
       if (IsFull(S))
    -      Error("Full stack");
    +      Error("Full stack");
       else
           S->Array[ ++S->TopOfStack ] = X;
     }
    @@ -5653,7 +5653,7 @@ 

    Array Implementation of Stacks

    { if(! IsEmpty(S)) return S->Array[ S->TopOfStack ]; - Error("Empty stack") ; + Error("Empty stack") ; return O; /* Return value used to avoid warning*/ }
    @@ -5666,7 +5666,7 @@

    Array Implementation of Stacks

    7
    void Pop(Stack S)
     {
       if(IsEmpty(S))
    -      Error("Empty stack") ;
    +      Error("Empty stack") ;
       else
           S->TopOfStack--;
     }
    @@ -5681,7 +5681,7 @@ 

    Array Implementation of Stacks

    { if(!Is Empty(S)) return S->Array[ S->TopOfStack-- ]; - Error("Empty stack"); + Error("Empty stack"); return O; /* Return value used to avoid warnin */ }
    @@ -5742,11 +5742,11 @@

    Application

    Function Calls (System Stack)

    -

    3-2

    +

    3-2

    Note : Recursion can always be completely removed. Non recursive programs are generally faster than equivalent recursive programs. However, recursive programs are in general much simpler and easier to understand.

    -
    +

    2.4 The Queue ADT

    -

    6-2

    -

    image-20210125070700824

    +

    6-2

    +

    image-20210125070700824

    正确答案是4,注意“in the process”

    -
    +

    5 The Disjoint Set

    5.1 Equivalence Relations

    [Definition] A relation, ~, over a set, S, is said to be an equivalence relation over S if it is symmetric, reflexive, and transitive over S.

    [Definition] Two members x and y of a set S are said to be in the same equivalence class if x ~ y.

    -
    +

    5.2 The Dynamic Equivalence Problem

    -
    +

    5.3 Basic Data Structure

    Union( \(i, j\) )

    -

    7-1

    +

    7-1