├── README.md ├── 作业LaTeX解答-期末复习版 ├── UCAS-Algorithm-design-Homework-Chap1&2 │ ├── homework.aux │ ├── homework.listing │ ├── homework.log │ ├── homework.out │ ├── homework.pdf │ ├── homework.sty │ ├── homework.synctex.gz │ ├── homework.tex │ ├── images │ │ └── title │ │ │ ├── 2-连通分支.pdf │ │ │ ├── Cyber.jpg │ │ │ ├── ucas-logo.png │ │ │ ├── ucas_logo 1.pdf │ │ │ ├── 出入栈模拟.pdf │ │ │ ├── 无向图G.pdf │ │ │ └── 最低深索数求解.pdf │ └── 计算机算法设计与分析-Chap1&2作业-整合版.pdf ├── UCAS-Algorithm-design-Homework-Chap3 │ ├── homework.aux │ ├── homework.listing │ ├── homework.log │ ├── homework.out │ ├── homework.pdf │ ├── homework.sty │ ├── homework.synctex.gz │ ├── homework.tex │ ├── images │ │ └── title │ │ │ ├── Cyber.jpg │ │ │ ├── ucas-logo.png │ │ │ ├── ucas_logo 1.pdf │ │ │ ├── 汉诺塔问题.pdf │ │ │ ├── 递归树1.pdf │ │ │ ├── 递归树2.pdf │ │ │ └── 递归树3.pdf │ └── 计算机算法设计与分析-Chap3作业-整合版.pdf ├── UCAS-Algorithm-design-Homework-Chap4 │ ├── homework.aux │ ├── homework.listing │ ├── homework.log │ ├── homework.out │ ├── homework.pdf │ ├── homework.sty │ ├── homework.synctex.gz │ ├── homework.tex │ ├── images │ │ └── title │ │ │ ├── Cyber.jpg │ │ │ ├── Huffman树.pdf │ │ │ ├── ucas-logo.png │ │ │ └── ucas_logo 1.pdf │ └── 计算机算法设计与分析-Chap4作业-整合版.pdf ├── UCAS-Algorithm-design-Homework-Chap5 │ ├── homework.aux │ ├── homework.listing │ ├── homework.log │ ├── homework.out │ ├── homework.pdf │ ├── homework.sty │ ├── homework.synctex.gz │ ├── homework.tex │ ├── images │ │ └── title │ │ │ ├── 5边形的划分方案.pdf │ │ │ ├── Cyber.jpg │ │ │ ├── ucas-logo.png │ │ │ ├── ucas_logo 1.pdf │ │ │ └── 子问题归约.pdf │ └── 计算机算法设计与分析-Chap5作业-整合版.pdf ├── UCAS-Algorithm-design-Homework-Chap6&7 │ ├── homework.aux │ ├── homework.listing │ ├── homework.log │ ├── homework.out │ ├── homework.pdf │ ├── homework.sty │ ├── homework.synctex.gz │ ├── homework.tex │ ├── images │ │ └── title │ │ │ ├── Cyber.jpg │ │ │ ├── Latin方.pdf │ │ │ ├── Latin方结果.pdf │ │ │ ├── ucas-logo.png │ │ │ ├── ucas_logo 1.pdf │ │ │ ├── 旅行商问题.pdf │ │ │ └── 解空间树搜索图.pdf │ └── 计算机算法设计与分析-Chap6&7作业-整合版.pdf ├── UCAS-Algorithm-design-Homework-Chap8 │ ├── homework.aux │ ├── homework.listing │ ├── homework.log │ ├── homework.out │ ├── homework.pdf │ ├── homework.sty │ ├── homework.synctex.gz │ ├── homework.tex │ ├── images │ │ └── title │ │ │ ├── Cyber.jpg │ │ │ ├── P-NP-NPC-NPH问题关系图.pdf │ │ │ ├── ucas-logo.png │ │ │ └── ucas_logo 1.pdf │ └── 计算机算法设计与分析-Chap8作业-整合版.pdf ├── UCAS-Algorithm-design-Homework-Chap9&10&11 │ ├── homework.aux │ ├── homework.listing │ ├── homework.log │ ├── homework.out │ ├── homework.pdf │ ├── homework.sty │ ├── homework.synctex.gz │ ├── homework.tex │ ├── images │ │ └── title │ │ │ ├── Cyber.jpg │ │ │ ├── P-NP-NPC-NPH问题关系图.pdf │ │ │ ├── ucas-logo.png │ │ │ ├── ucas_logo 1.pdf │ │ │ └── 补充练习.png │ └── 计算机算法设计与分析-Chap9&10&11作业-整合版.pdf ├── 计算机算法设计与分析-Chap1&2作业-整合版.pdf ├── 计算机算法设计与分析-Chap3作业-整合版.pdf ├── 计算机算法设计与分析-Chap4作业-整合版.pdf ├── 计算机算法设计与分析-Chap5作业-整合版.pdf ├── 计算机算法设计与分析-Chap6&7作业-整合版.pdf ├── 计算机算法设计与分析-Chap8作业-整合版.pdf └── 计算机算法设计与分析-Chap9&10&11作业-整合版.pdf ├── 作业LaTeX解答-正式提交版 ├── UCAS-Algorithm-design-Homework-Chap1&2 │ ├── homework.aux │ ├── homework.listing │ ├── homework.log │ ├── homework.out │ ├── homework.pdf │ ├── homework.sty │ ├── homework.synctex.gz │ ├── homework.tex │ ├── images │ │ └── title │ │ │ ├── 2-连通分支.pdf │ │ │ ├── Cyber.jpg │ │ │ ├── ucas-logo.png │ │ │ ├── ucas_logo 1.pdf │ │ │ ├── 出入栈模拟.pdf │ │ │ ├── 无向图G.pdf │ │ │ └── 最低深索数求解.pdf │ └── 计算机算法设计与分析-Chap1&2作业-周胤昌.pdf ├── UCAS-Algorithm-design-Homework-Chap3 │ ├── homework.aux │ ├── homework.listing │ ├── homework.log │ ├── homework.out │ ├── homework.pdf │ ├── homework.sty │ ├── homework.synctex.gz │ ├── homework.tex │ ├── images │ │ └── title │ │ │ ├── 2-连通分支.pdf │ │ │ ├── Cyber.jpg │ │ │ ├── ucas-logo.png │ │ │ ├── ucas_logo 1.pdf │ │ │ ├── 汉诺塔问题.pdf │ │ │ ├── 递归树1.pdf │ │ │ ├── 递归树2.pdf │ │ │ └── 递归树3.pdf │ └── 计算机算法设计与分析-Chap3作业-周胤昌.pdf ├── UCAS-Algorithm-design-Homework-Chap4 │ ├── homework.aux │ ├── homework.listing │ ├── homework.log │ ├── homework.out │ ├── homework.pdf │ ├── homework.sty │ ├── homework.synctex.gz │ ├── homework.tex │ ├── images │ │ └── title │ │ │ ├── Cyber.jpg │ │ │ ├── Huffman树.pdf │ │ │ ├── ucas-logo.png │ │ │ └── ucas_logo 1.pdf │ └── 计算机算法设计与分析-Chap4作业-周胤昌.pdf ├── UCAS-Algorithm-design-Homework-Chap5 │ ├── homework.aux │ ├── homework.listing │ ├── homework.log │ ├── homework.out │ ├── homework.pdf │ ├── homework.sty │ ├── homework.synctex.gz │ ├── homework.tex │ ├── images │ │ └── title │ │ │ ├── 5边形的划分方案.pdf │ │ │ ├── Cyber.jpg │ │ │ ├── ucas-logo.png │ │ │ ├── ucas_logo 1.pdf │ │ │ └── 子问题归约.pdf │ └── 计算机算法设计与分析-Chap5作业-周胤昌.pdf ├── UCAS-Algorithm-design-Homework-Chap6&7 │ ├── homework.aux │ ├── homework.listing │ ├── homework.log │ ├── homework.out │ ├── homework.pdf │ ├── homework.sty │ ├── homework.synctex.gz │ ├── homework.tex │ ├── images │ │ └── title │ │ │ ├── Cyber.jpg │ │ │ ├── Latin方.pdf │ │ │ ├── Latin方结果.pdf │ │ │ ├── ucas-logo.png │ │ │ ├── ucas_logo 1.pdf │ │ │ ├── 旅行商问题.pdf │ │ │ └── 解空间树搜索图.pdf │ └── 计算机算法设计与分析-Chap6&7作业-周胤昌.pdf ├── UCAS-Algorithm-design-Homework-Chap8 │ ├── homework.aux │ ├── homework.listing │ ├── homework.log │ ├── homework.out │ ├── homework.pdf │ ├── homework.sty │ ├── homework.synctex.gz │ ├── homework.tex │ ├── images │ │ └── title │ │ │ ├── Cyber.jpg │ │ │ ├── P-NP-NPC-NPH问题关系图.agx │ │ │ ├── P-NP-NPC-NPH问题关系图.pdf │ │ │ ├── ucas-logo.png │ │ │ └── ucas_logo 1.pdf │ └── 计算机算法设计与分析-Chap8作业-周胤昌.pdf ├── UCAS-Algorithm-design-Homework-Chap9&10&11 │ ├── homework.aux │ ├── homework.listing │ ├── homework.log │ ├── homework.out │ ├── homework.pdf │ ├── homework.sty │ ├── homework.synctex.gz │ ├── homework.tex │ ├── images │ │ └── title │ │ │ ├── Cyber.jpg │ │ │ ├── ucas-logo.png │ │ │ └── ucas_logo 1.pdf │ └── 计算机算法设计与分析-Chap9&10&11作业-周胤昌.pdf ├── UCAS-Algorithm-design-Homework-考试后作业 │ ├── homework.aux │ ├── homework.listing │ ├── homework.log │ ├── homework.out │ ├── homework.pdf │ ├── homework.sty │ ├── homework.synctex.gz │ ├── homework.tex │ ├── images │ │ └── title │ │ │ ├── Cyber.jpg │ │ │ ├── sol-1.png │ │ │ ├── sol-2.png │ │ │ ├── sol-3.png │ │ │ ├── sol-4.png │ │ │ ├── sol-5.png │ │ │ ├── sol-6.png │ │ │ ├── ucas-logo.png │ │ │ ├── ucas_logo 1.pdf │ │ │ ├── 最优解路线图.pdf │ │ │ ├── 模拟退火算法优化过程图.pdf │ │ │ └── 随机路线图.pdf │ ├── 作业代码 │ │ ├── 0-1背包遗传算法.py │ │ ├── LasVegas+分支限界_电路板布线.cpp │ │ └── TSP模拟退火Matlab代码 │ │ │ ├── Distance.m │ │ │ ├── DrawPath.m │ │ │ ├── Metropolis.m │ │ │ ├── NewAnswer.m │ │ │ ├── OutputPath.m │ │ │ ├── PathLength.m │ │ │ └── main.m │ └── 实验结果图 │ │ ├── sol-1.png │ │ ├── sol-2.png │ │ ├── sol-3.png │ │ ├── sol-4.png │ │ ├── sol-5.png │ │ ├── sol-6.png │ │ ├── 最优解路线图.pdf │ │ ├── 模拟退火算法优化过程图.pdf │ │ └── 随机路线图.pdf ├── 拉斯维加斯算法结合分枝限界算法解决电路板布线问题.doc ├── 拉斯维加斯算法结合分枝限界算法解决电路板布线问题.pdf ├── 计算机算法设计与分析-Chap1&2作业-周胤昌.pdf ├── 计算机算法设计与分析-Chap3作业-周胤昌.pdf ├── 计算机算法设计与分析-Chap4作业-周胤昌.pdf ├── 计算机算法设计与分析-Chap5作业-周胤昌.pdf ├── 计算机算法设计与分析-Chap6&7作业-周胤昌.pdf ├── 计算机算法设计与分析-Chap8作业-周胤昌.pdf ├── 计算机算法设计与分析-Chap9&10&11作业-周胤昌.pdf ├── 计算机算法设计与分析-周胤昌作业-正式提交版.pdf └── 计算机算法设计与分析-考试后作业-周胤昌.pdf ├── 作业题目+老师解答 ├── 第1,2章练习.pdf ├── 第1,2章练习参考答案.pdf ├── 第3章练习.pdf ├── 第3章练习参考答案.pdf ├── 第4章贪心算法练习.pdf ├── 第4章贪心算法练习参考答案.pdf ├── 第5章动态规划练习.pdf ├── 第5章动态规划练习参考答案.pdf ├── 第6,7章练习.pdf ├── 第6,7章练习参考答案.pdf ├── 第8章练习参考答案.pdf ├── 第8章问题复杂度与NP完全性练习.pdf ├── 第9 10 11章练习参考答案.pdf └── 第9-10-11章练习.pdf ├── 算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听) ├── DC-2022.pdf ├── DP-2022.pdf ├── Greedy-2022.pdf ├── UCAS-Algorithm-design-Homework-Chap2 │ ├── homework.aux │ ├── homework.listing │ ├── homework.log │ ├── homework.out │ ├── homework.pdf │ ├── homework.sty │ ├── homework.synctex.gz │ ├── homework.tex │ ├── images │ │ └── title │ │ │ ├── Cyber.jpg │ │ │ ├── ucas-logo.png │ │ │ ├── ucas_logo 1.pdf │ │ │ ├── 三路快速排序.agx │ │ │ ├── 三路快速排序.pdf │ │ │ ├── 二叉树直径.agx │ │ │ ├── 二叉树直径.pdf │ │ │ ├── 翻转二叉树.agx │ │ │ └── 翻转二叉树.pdf │ └── 计算机算法设计与分析-Chap2作业-周胤昌.pdf ├── UCAS-Algorithm-design-Homework-Chap3 │ ├── homework.aux │ ├── homework.listing │ ├── homework.log │ ├── homework.out │ ├── homework.pdf │ ├── homework.sty │ ├── homework.synctex.gz │ ├── homework.tex │ ├── images │ │ └── title │ │ │ ├── Cyber.jpg │ │ │ ├── ucas-logo.png │ │ │ ├── ucas_logo 1.pdf │ │ │ └── 二叉搜索树示例.pdf │ └── 计算机算法设计与分析-Chap3作业-周胤昌.pdf ├── UCAS-Algorithm-design-Homework-Chap4 │ ├── homework.aux │ ├── homework.listing │ ├── homework.log │ ├── homework.out │ ├── homework.pdf │ ├── homework.sty │ ├── homework.synctex.gz │ ├── homework.tex │ └── 计算机算法设计与分析-Chap4作业-周胤昌.pdf ├── 卜算OJ作业代码 │ ├── 1-OJ-C++代码 │ │ ├── A-1.py │ │ ├── B-2.c │ │ ├── B-2.cpp │ │ ├── C-3.cpp │ │ ├── D-4.cpp │ │ └── E-5.cpp │ ├── 2-OJ-C++代码 │ │ ├── A-1.cpp │ │ ├── B-2.cpp │ │ ├── C-3.cpp │ │ ├── D-4.cpp │ │ └── E-5.cpp │ └── 3-OJ-C++代码 │ │ ├── A.cpp │ │ ├── B.cpp │ │ ├── C.cpp │ │ ├── D.cpp │ │ └── E.cpp ├── 算法讲义_卜东波.pdf ├── 计算机算法设计与分析(卜算)-Chap2作业-周胤昌.pdf ├── 计算机算法设计与分析(卜算)-Chap3作业-周胤昌.pdf └── 计算机算法设计与分析(卜算)-Chap4作业-周胤昌.pdf ├── 算法设计与分析-陈玉福(可作为刘算的补充资料) ├── UCAS_算法设计-陈玉福-Github资料 │ ├── 往年试卷 │ │ ├── 2018-2019计算机算法设计与分析_国科大_陈玉福.pdf │ │ ├── 2018-2019试题部分答案——陈玉福.pdf │ │ ├── 2018-2019马.pdf │ │ ├── 2018-2019马答案第一题.docx │ │ ├── 2019-12-24计算机算法设计与分析陈玉福老师——回忆版.pdf │ │ ├── README.txt │ │ ├── 中科院_算法试题_陈玉福.docx │ │ ├── 中科院计算机算法设计与分析各章作业+历年习题.pdf │ │ ├── 中科院陈玉福计算机算法设计与分析期末简答题答案.pdf │ │ ├── 算法设计与分析历年真题归纳总结.pdf │ │ ├── 算法设计与分析期末部分考题答案.pdf │ │ ├── 算法设计与分析试题2005A.doc │ │ ├── 算法设计与分析试题2006A.doc │ │ ├── 算法设计与分析试题2007A.doc │ │ ├── 算法设计与分析试题2008A.doc │ │ ├── 算法设计与分析试题2009A.doc │ │ ├── 算法设计与分析试题2010A.doc │ │ ├── 算法设计与分析试题2011秋.doc │ │ ├── 算法设计与分析试题2011补考.doc │ │ ├── 算法试题.pdf │ │ └── 考试范围.pdf │ ├── 第一章作业 │ │ ├── README.txt │ │ └── 第三周作业.pdf │ ├── 第七章作业 │ │ ├── 7_2.py │ │ ├── 7_3_2.py │ │ ├── README.txt │ │ └── 张子钰_第七次作业.pdf │ ├── 第三章作业 │ │ ├── README.txt │ │ ├── mergeSort.py │ │ ├── quickSort.py │ │ └── 第七周作业.pdf │ ├── 第二章作业 │ │ ├── README.txt │ │ └── 第五周作业.pdf │ ├── 第五章作业 │ │ ├── A11.py │ │ ├── A13.py │ │ ├── A2.py │ │ ├── README.txt │ │ └── 张子钰_第五次作业.pdf │ ├── 第八章作业 │ │ ├── README.txt │ │ └── 张子钰_第八次作业.pdf │ ├── 第六章作业 │ │ ├── 6.pdf │ │ ├── 6_2.py │ │ ├── 6_3.py │ │ ├── 6_5.py │ │ └── README.txt │ └── 第四章作业 │ │ ├── 4.py │ │ ├── README.txt │ │ └── 张子钰_第四次作业.pdf ├── 算法设计与分析作业-陈玉福-教材答案+试卷.pdf └── 陈玉福讲义补充材料 │ ├── CSP.pptx │ ├── SAT.ppt │ ├── Symmetry Breaking.ppt │ ├── 第八章.ppt │ ├── 补充讲义.pdf │ └── 近似算法.ppt ├── 算法设计与分析PPT-期末复习版.pdf ├── 算法设计与分析作业解答-期末复习版.pdf ├── 算法设计与分析作业解答-正式提交版.pdf ├── 算法设计与分析讲义(最新版).pdf ├── 算法设计与分析讲义(老版).pdf └── 计算机算法设计与分析-期末试卷整理(含往年) ├── UCAS-Algorithm-design-2021试卷解答整理.pdf ├── UCAS-Algorithm-design-2021试卷解答整理 ├── UCAS-Algorithm-design-2021试卷解答整理.pdf ├── homework.aux ├── homework.listing ├── homework.log ├── homework.out ├── homework.pdf ├── homework.sty ├── homework.synctex.gz ├── homework.tex └── images │ └── title │ ├── Cyber.jpg │ ├── ucas-logo.png │ └── ucas_logo 1.pdf ├── UCAS-Algorithm-design-2022试卷解答整理.pdf ├── UCAS-Algorithm-design-2022试卷解答整理 ├── UCAS-Algorithm-design-2022试卷解答整理.pdf ├── homework.aux ├── homework.listing ├── homework.log ├── homework.out ├── homework.pdf ├── homework.sty ├── homework.synctex.gz ├── homework.tex └── images │ └── title │ ├── Cyber.jpg │ ├── ucas-logo.png │ └── ucas_logo 1.pdf ├── 算法设计与分析-2模拟试题2022.pdf ├── 算法设计与分析-2试题2022.pdf ├── 算法设计与分析大纲_083500M01001H_2.pdf ├── 考试复习大纲2019.jpg ├── 考试复习大纲2020.pdf ├── 计算机算法设计与分析考试复习大纲2022.pdf └── 计算机算法设计与分析考试通知.pdf /README.md: -------------------------------------------------------------------------------- 1 | # -2022-UCAS_Algorithm_Design_LYG 2 | 此为本人在2022秋季学期所修《计算机算法设计与分析》课程(授课老师为刘玉贵)期间所整理的资料。 3 | 主要包括平时作业和对应LaTeX代码以及上机作业题的C++代码,以及针对期末考纲且专门用于期末复习而做出删减整合的复习版作业。 4 | 并且本人也对老师的上课PPT做出了删减整合以更高效率的复习,我也对2021年和2022年的刘算期末试题做了LaTeX整理和解答,其实可以发现都是些作业题,因此读者不必过于担心期末考试。 5 | 6 | 本人在此学期旁听卜东波老师的算法设计课程时,也整理了详尽而易懂的作业解答(共3次),并且也整理了OJ代码(共3次),语言以C++为主。 7 | 刘算的期末题目都是平常作业而卜算则不然(其实也有相当部分的题目是作业变形),因此此处强烈建议读者选刘玉贵老师的课,并同时对卜老师的算法课进行旁听。这样可以避免期末复习难度过高(但刘算有点纸上谈兵),又可以通过跟班旁听卜算+写对应的作业+写OJ题目来学到真东西,属实是两不误了。 8 | 另外,我也对陈玉福老师的补充材料进行了整理,这些材料其实是辅助作用的,因此建议读者以刘算+卜算的内容为主。 9 | -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap1&2/homework.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | \providecommand\hyper@newdestlabel[2]{} 3 | \providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} 4 | \HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined 5 | \global\let\oldcontentsline\contentsline 6 | \gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} 7 | \global\let\oldnewlabel\newlabel 8 | \gdef\newlabel#1#2{\newlabelxx{#1}#2} 9 | \gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} 10 | \AtEndDocument{\ifx\hyper@anchor\@undefined 11 | \let\contentsline\oldcontentsline 12 | \let\newlabel\oldnewlabel 13 | \fi} 14 | \fi} 15 | \global\let\hyper@last\relax 16 | \gdef\HyperFirstAtBeginDocument#1{#1} 17 | \providecommand*\HyPL@Entry[1]{} 18 | \HyPL@Entry{0<>} 19 | \@writefile{toc}{\contentsline {section}{Problem 1}{2}{section*.1}\protected@file@percent } 20 | \@writefile{toc}{\contentsline {section}{Problem 2}{2}{section*.2}\protected@file@percent } 21 | \@writefile{toc}{\contentsline {section}{Problem 3}{3}{section*.3}\protected@file@percent } 22 | \@writefile{toc}{\contentsline {section}{Problem 4}{3}{section*.4}\protected@file@percent } 23 | \@writefile{toc}{\contentsline {section}{Problem 5}{4}{section*.5}\protected@file@percent } 24 | \@writefile{toc}{\contentsline {section}{Problem 6}{4}{section*.6}\protected@file@percent } 25 | \@writefile{loa}{\contentsline {algorithm}{\numberline {1}{\ignorespaces 选择排序\relax }}{4}{algorithm.1}\protected@file@percent } 26 | \providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}} 27 | \newlabel{alg:选择排序}{{1}{4}{选择排序\relax }{algorithm.1}{}} 28 | \@writefile{toc}{\contentsline {section}{Problem 7}{5}{section*.7}\protected@file@percent } 29 | \@writefile{toc}{\contentsline {section}{Problem 8}{5}{section*.8}\protected@file@percent } 30 | \@writefile{lot}{\contentsline {table}{\numberline {1}{\ignorespaces 原始表格\relax }}{5}{table.caption.9}\protected@file@percent } 31 | \newlabel{原始表格}{{1}{5}{原始表格\relax }{table.caption.9}{}} 32 | \@writefile{lot}{\contentsline {table}{\numberline {2}{\ignorespaces 解答\relax }}{5}{table.caption.10}\protected@file@percent } 33 | \newlabel{解答}{{2}{5}{解答\relax }{table.caption.10}{}} 34 | \bibstyle{unsrt} 35 | \bibdata{refs} 36 | \@writefile{toc}{\contentsline {section}{Problem 9}{6}{section*.11}\protected@file@percent } 37 | \gdef \@abspage@last{6} 38 | -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap1&2/homework.listing: -------------------------------------------------------------------------------- 1 | /*找最大最小元素 (方法二)*/ 2 | template 3 | bool MinMax(T a[], int n, int& Min, int& Max) { 4 | //寻找a[0:n-1]中的最小元素与最大元素 5 | //如果数组中的元素数目小于1, 则返回false 6 | if(n<1) return false; 7 | Min=Max=0; //初始化 8 | for(int i=1; ia[i]) Min=i; 10 | else if(a[Max]& nums) { 5 | count = 0; 6 | MergeSort(nums, 0, nums.size() - 1); 7 | return count; 8 | } 9 | 10 | void Merge(vector& nums, int low , int mid, int high) { 11 | int i = low, j = mid + 1, k = 0; 12 | vector temp(high - low + 1); 13 | while(i <= mid && j <= high) { 14 | if(nums[i] <= nums[j]) 15 | temp[k++] = nums[i++]; //此情形下逆序数没有增量 16 | else { 17 | temp[k++] = nums[j++]; 18 | count += mid - i + 1; //此情形下逆序数才能有增量 19 | } 20 | } 21 | while(i <= mid) temp[k++] = nums[i++]; //把剩下的nums左半数组接上 22 | while(j <= high) temp[k++] = nums[j++]; //把剩下的nums右半数组接上 23 | copy(temp.begin(), temp.end(), nums.begin() + low); //把临时数组的元素拷贝回nums 24 | vector().swap(temp); //清除容器并最小化它的容量 25 | } 26 | 27 | void MergeSort(vector& nums, int low, int high) { 28 | if(low < high) { 29 | int mid = (low + high) >> 1; 30 | MergeSort(nums, low, mid); 31 | MergeSort(nums, mid + 1, high); 32 | Merge(nums, low, mid, high); 33 | } 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap3/homework.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [1][-]{section*.1}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001}{}% 1 2 | \BOOKMARK [1][-]{section*.2}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0002}{}% 2 3 | \BOOKMARK [1][-]{section*.3}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0003}{}% 3 4 | \BOOKMARK [1][-]{section*.4}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0004}{}% 4 5 | \BOOKMARK [1][-]{section*.6}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0005}{}% 5 6 | \BOOKMARK [1][-]{section*.7}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0006}{}% 6 7 | \BOOKMARK [1][-]{section*.8}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0007}{}% 7 8 | \BOOKMARK [1][-]{section*.9}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0008}{}% 8 9 | \BOOKMARK [1][-]{section*.10}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0009}{}% 9 10 | \BOOKMARK [1][-]{section*.13}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0000}{}% 10 11 | \BOOKMARK [1][-]{section*.14}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0001}{}% 11 12 | -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap3/homework.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap3/homework.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap3/homework.synctex.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap3/homework.synctex.gz -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap3/images/title/Cyber.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap3/images/title/Cyber.jpg -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap3/images/title/ucas-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap3/images/title/ucas-logo.png -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap3/images/title/ucas_logo 1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap3/images/title/ucas_logo 1.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap3/images/title/汉诺塔问题.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap3/images/title/汉诺塔问题.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap3/images/title/递归树1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap3/images/title/递归树1.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap3/images/title/递归树2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap3/images/title/递归树2.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap3/images/title/递归树3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap3/images/title/递归树3.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap3/计算机算法设计与分析-Chap3作业-整合版.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap3/计算机算法设计与分析-Chap3作业-整合版.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap4/homework.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | \providecommand\hyper@newdestlabel[2]{} 3 | \providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} 4 | \HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined 5 | \global\let\oldcontentsline\contentsline 6 | \gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} 7 | \global\let\oldnewlabel\newlabel 8 | \gdef\newlabel#1#2{\newlabelxx{#1}#2} 9 | \gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} 10 | \AtEndDocument{\ifx\hyper@anchor\@undefined 11 | \let\contentsline\oldcontentsline 12 | \let\newlabel\oldnewlabel 13 | \fi} 14 | \fi} 15 | \global\let\hyper@last\relax 16 | \gdef\HyperFirstAtBeginDocument#1{#1} 17 | \providecommand*\HyPL@Entry[1]{} 18 | \HyPL@Entry{0<>} 19 | \@writefile{toc}{\contentsline {section}{Problem 1}{2}{section*.1}\protected@file@percent } 20 | \@writefile{loa}{\contentsline {algorithm}{\numberline {1}{\ignorespaces \textbf {Service}算法\relax }}{2}{algorithm.1}\protected@file@percent } 21 | \providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}} 22 | \newlabel{alg:Service}{{1}{2}{\textbf {Service}算法\relax }{algorithm.1}{}} 23 | \@writefile{toc}{\contentsline {section}{Problem 2}{3}{section*.2}\protected@file@percent } 24 | \@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Huffman树\relax }}{3}{figure.caption.3}\protected@file@percent } 25 | \newlabel{fig:Huffman树}{{1}{3}{Huffman树\relax }{figure.caption.3}{}} 26 | \newlabel{inequ1}{{2}{3}{Problem \arabic {homeworkProblemCounter}}{equation.0.2}{}} 27 | \@writefile{toc}{\contentsline {section}{Problem 3}{4}{section*.4}\protected@file@percent } 28 | \@writefile{toc}{\contentsline {section}{Problem 4}{5}{section*.5}\protected@file@percent } 29 | \@writefile{loa}{\contentsline {algorithm}{\numberline {2}{\ignorespaces \textbf {HuffmanCode}算法\relax }}{5}{algorithm.2}\protected@file@percent } 30 | \newlabel{alg:HuffmanCode}{{2}{5}{\textbf {HuffmanCode}算法\relax }{algorithm.2}{}} 31 | \@writefile{toc}{\contentsline {section}{Problem 5}{5}{section*.6}\protected@file@percent } 32 | \@writefile{toc}{\contentsline {section}{Problem 6}{6}{section*.7}\protected@file@percent } 33 | \@writefile{loa}{\contentsline {algorithm}{\numberline {3}{\ignorespaces \textbf {Location}算法\relax }}{6}{algorithm.3}\protected@file@percent } 34 | \newlabel{alg:Location}{{3}{6}{\textbf {Location}算法\relax }{algorithm.3}{}} 35 | \@writefile{toc}{\contentsline {section}{Problem 7}{7}{section*.8}\protected@file@percent } 36 | \@writefile{loa}{\contentsline {algorithm}{\numberline {4}{\ignorespaces \textbf {Test}算法\relax }}{7}{algorithm.4}\protected@file@percent } 37 | \newlabel{alg:Test}{{4}{7}{\textbf {Test}算法\relax }{algorithm.4}{}} 38 | \bibstyle{unsrt} 39 | \bibdata{refs} 40 | \@writefile{toc}{\contentsline {section}{Problem 8}{8}{section*.9}\protected@file@percent } 41 | \@writefile{loa}{\contentsline {algorithm}{\numberline {5}{\ignorespaces \textbf {Work}算法\relax }}{8}{algorithm.5}\protected@file@percent } 42 | \newlabel{alg:Work}{{5}{8}{\textbf {Work}算法\relax }{algorithm.5}{}} 43 | \gdef \@abspage@last{8} 44 | -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap4/homework.listing: -------------------------------------------------------------------------------- 1 | string Huff_Decode(Node huffTree[], int n,string s) 2 | { 3 | cout << "解码后为: "; 4 | string temp = "", str = "";//保存解码后的字符串 5 | for (int i = 0; i < s.size(); i++) 6 | { 7 | temp = temp + s[i]; 8 | for (int j = 0; j < n; j++) 9 | { 10 | if (temp == huffTree[j].code) 11 | { 12 | str = str + huffTree[j].ch; 13 | temp = ""; 14 | break; 15 | } 16 | else if (i == s.size()-1 && j == n-1 && temp != "")//全部遍历后没有 17 | { 18 | str = "解码错误!"; 19 | } 20 | } 21 | } 22 | return str; 23 | } 24 | 25 | int main() 26 | { 27 | //编码过程 28 | const int n = 5; 29 | Node huffTree[2 * n]; 30 | string str[] = { "A", "B", "C", "D", "E"}; 31 | int w[] = { 30, 30, 5, 20, 15 }; 32 | Huff_Tree(huffTree, w, str, n); 33 | Huff_Code(huffTree, n); 34 | //解码过程 35 | string s; 36 | cout << "输入编码:"; 37 | cin >> s; 38 | cout << Huff_Decode(huffTree, n, s) << endl; 39 | system("pause"); 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap4/homework.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [1][-]{section*.1}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001}{}% 1 2 | \BOOKMARK [1][-]{section*.2}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0002}{}% 2 3 | \BOOKMARK [1][-]{section*.4}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0003}{}% 3 4 | \BOOKMARK [1][-]{section*.5}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0004}{}% 4 5 | \BOOKMARK [1][-]{section*.6}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0005}{}% 5 6 | \BOOKMARK [1][-]{section*.7}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0006}{}% 6 7 | \BOOKMARK [1][-]{section*.8}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0007}{}% 7 8 | \BOOKMARK [1][-]{section*.9}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0008}{}% 8 9 | -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap4/homework.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap4/homework.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap4/homework.synctex.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap4/homework.synctex.gz -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap4/images/title/Cyber.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap4/images/title/Cyber.jpg -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap4/images/title/Huffman树.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap4/images/title/Huffman树.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap4/images/title/ucas-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap4/images/title/ucas-logo.png -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap4/images/title/ucas_logo 1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap4/images/title/ucas_logo 1.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap4/计算机算法设计与分析-Chap4作业-整合版.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap4/计算机算法设计与分析-Chap4作业-整合版.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap5/homework.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | \providecommand\hyper@newdestlabel[2]{} 3 | \providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} 4 | \HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined 5 | \global\let\oldcontentsline\contentsline 6 | \gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} 7 | \global\let\oldnewlabel\newlabel 8 | \gdef\newlabel#1#2{\newlabelxx{#1}#2} 9 | \gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} 10 | \AtEndDocument{\ifx\hyper@anchor\@undefined 11 | \let\contentsline\oldcontentsline 12 | \let\newlabel\oldnewlabel 13 | \fi} 14 | \fi} 15 | \global\let\hyper@last\relax 16 | \gdef\HyperFirstAtBeginDocument#1{#1} 17 | \providecommand*\HyPL@Entry[1]{} 18 | \HyPL@Entry{0<>} 19 | \@writefile{toc}{\contentsline {section}{Problem 1}{2}{section*.1}\protected@file@percent } 20 | \@writefile{loa}{\contentsline {algorithm}{\numberline {1}{\ignorespaces \textbf {MaxSubSum}($A$, left, right)\relax }}{3}{algorithm.1}\protected@file@percent } 21 | \providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}} 22 | \newlabel{alg:MaxSubSum}{{1}{3}{\textbf {MaxSubSum}($A$, left, right)\relax }{algorithm.1}{}} 23 | \@writefile{toc}{\contentsline {section}{Problem 2}{4}{section*.2}\protected@file@percent } 24 | \@writefile{toc}{\contentsline {section}{Problem 3}{5}{section*.3}\protected@file@percent } 25 | \@writefile{toc}{\contentsline {section}{Problem 4}{6}{section*.4}\protected@file@percent } 26 | \@writefile{toc}{\contentsline {section}{Problem 5}{7}{section*.5}\protected@file@percent } 27 | \@writefile{toc}{\contentsline {section}{Problem 6}{8}{section*.6}\protected@file@percent } 28 | \@writefile{loa}{\contentsline {algorithm}{\numberline {2}{\ignorespaces \textbf {Homework}算法\relax }}{9}{algorithm.2}\protected@file@percent } 29 | \newlabel{alg:Homework}{{2}{9}{\textbf {Homework}算法\relax }{algorithm.2}{}} 30 | \@writefile{toc}{\contentsline {section}{Problem 7}{9}{section*.7}\protected@file@percent } 31 | \@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces 子问题归约图\relax }}{9}{figure.caption.8}\protected@file@percent } 32 | \newlabel{fig:子问题归约}{{1}{9}{子问题归约图\relax }{figure.caption.8}{}} 33 | \bibstyle{unsrt} 34 | \bibdata{refs} 35 | \gdef \@abspage@last{10} 36 | -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap5/homework.listing: -------------------------------------------------------------------------------- 1 | void MatrixChain(int **d, int n, int **t, int **s) { 2 | for (int i = 1; i <= n; i++) t[i][i] = 0; 3 | for (int r = 2; r <= n; r++){ 4 | for (int i = 1; i <= n - r + 1; i++){ 5 | int j = i + r - 1; 6 | t[i][j] = t[i + 1][j] + d[i - 1][i] + d[i][j] + d[i - 1][j]; 7 | s[i][j] = i; 8 | for (int k = i + 1; k < j; k++){ 9 | int T = t[i][k] + t[k + 1][j] + d[i - 1][k] + d[k][j] + d[i - 1][j]; 10 | if(t < t[i][j]) { 11 | t[i][j] = t, s[i][j] = k; 12 | } 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap5/homework.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [1][-]{section*.1}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001}{}% 1 2 | \BOOKMARK [1][-]{section*.2}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0002}{}% 2 3 | \BOOKMARK [1][-]{section*.3}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0003}{}% 3 4 | \BOOKMARK [1][-]{section*.4}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0004}{}% 4 5 | \BOOKMARK [1][-]{section*.5}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0005}{}% 5 6 | \BOOKMARK [1][-]{section*.6}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0006}{}% 6 7 | \BOOKMARK [1][-]{section*.7}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0007}{}% 7 8 | -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap5/homework.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap5/homework.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap5/homework.synctex.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap5/homework.synctex.gz -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap5/images/title/5边形的划分方案.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap5/images/title/5边形的划分方案.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap5/images/title/Cyber.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap5/images/title/Cyber.jpg -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap5/images/title/ucas-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap5/images/title/ucas-logo.png -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap5/images/title/ucas_logo 1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap5/images/title/ucas_logo 1.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap5/images/title/子问题归约.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap5/images/title/子问题归约.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap5/计算机算法设计与分析-Chap5作业-整合版.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap5/计算机算法设计与分析-Chap5作业-整合版.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/homework.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | \providecommand\hyper@newdestlabel[2]{} 3 | \providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} 4 | \HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined 5 | \global\let\oldcontentsline\contentsline 6 | \gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} 7 | \global\let\oldnewlabel\newlabel 8 | \gdef\newlabel#1#2{\newlabelxx{#1}#2} 9 | \gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} 10 | \AtEndDocument{\ifx\hyper@anchor\@undefined 11 | \let\contentsline\oldcontentsline 12 | \let\newlabel\oldnewlabel 13 | \fi} 14 | \fi} 15 | \global\let\hyper@last\relax 16 | \gdef\HyperFirstAtBeginDocument#1{#1} 17 | \providecommand*\HyPL@Entry[1]{} 18 | \HyPL@Entry{0<>} 19 | \@writefile{toc}{\contentsline {section}{Problem 1}{2}{section*.1}\protected@file@percent } 20 | \@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces 旅行商问题\relax }}{2}{figure.caption.2}\protected@file@percent } 21 | \providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}} 22 | \newlabel{fig:旅行商问题}{{1}{2}{旅行商问题\relax }{figure.caption.2}{}} 23 | \@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces 解空间树搜索图\relax }}{2}{figure.caption.3}\protected@file@percent } 24 | \newlabel{fig:解空间树搜索图}{{2}{2}{解空间树搜索图\relax }{figure.caption.3}{}} 25 | \@writefile{toc}{\contentsline {section}{Problem 2}{3}{section*.4}\protected@file@percent } 26 | \@writefile{toc}{\contentsline {section}{Problem 3}{4}{section*.5}\protected@file@percent } 27 | \@writefile{loa}{\contentsline {algorithm}{\numberline {1}{\ignorespaces \textbf {Eaxtsetcover}$(U,k)$\relax }}{4}{algorithm.1}\protected@file@percent } 28 | \newlabel{alg:Eaxtsetcover}{{1}{4}{\textbf {Eaxtsetcover}$(U,k)$\relax }{algorithm.1}{}} 29 | \@writefile{toc}{\contentsline {section}{Problem 4}{4}{section*.6}\protected@file@percent } 30 | \bibstyle{unsrt} 31 | \bibdata{refs} 32 | \@writefile{toc}{\contentsline {section}{Problem 5}{6}{section*.7}\protected@file@percent } 33 | \@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces Latin方\relax }}{6}{figure.caption.8}\protected@file@percent } 34 | \newlabel{fig:Latin方}{{3}{6}{Latin方\relax }{figure.caption.8}{}} 35 | \gdef \@abspage@last{6} 36 | -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/homework.listing: -------------------------------------------------------------------------------- 1 | bool Latincheck(int X[4][4], int k, int row, int line) { 2 | for(int i = 0; i < row; i++) { 3 | if(X[i][line] == k) return false; 4 | } 5 | for(int j = 0; j < line; j++) { 6 | if(X[row][j] == k) return false; 7 | } 8 | return true; 9 | } 10 | void LatinMatrix(int X[4][4], int row, int line) { 11 | if(row == 3 && line == 3) { 12 | for(int i = 0; i < 4; i++) 13 | for(int j = 0; j < 4; j++) 14 | cout << X[i][j] << " "; 15 | return ; 16 | } 17 | else { 18 | for(int color = 1; color <= 4; color++) { 19 | if(Latincheck(X, color, row, line)) { 20 | X[row][line] = color; 21 | if(line < 3) LatinMatrix(X, row, line + 1); 22 | else if (line == 3 && row != 3) LatinMatrix(X, row + 1, 0); 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/homework.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [1][-]{section*.1}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001}{}% 1 2 | \BOOKMARK [1][-]{section*.4}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0002}{}% 2 3 | \BOOKMARK [1][-]{section*.5}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0003}{}% 3 4 | \BOOKMARK [1][-]{section*.6}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0004}{}% 4 5 | \BOOKMARK [1][-]{section*.7}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0005}{}% 5 6 | -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/homework.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/homework.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/homework.synctex.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/homework.synctex.gz -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/Cyber.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/Cyber.jpg -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/Latin方.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/Latin方.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/Latin方结果.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/Latin方结果.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/ucas-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/ucas-logo.png -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/ucas_logo 1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/ucas_logo 1.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/旅行商问题.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/旅行商问题.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/解空间树搜索图.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/解空间树搜索图.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/计算机算法设计与分析-Chap6&7作业-整合版.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap6&7/计算机算法设计与分析-Chap6&7作业-整合版.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap8/homework.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | \providecommand\hyper@newdestlabel[2]{} 3 | \providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} 4 | \HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined 5 | \global\let\oldcontentsline\contentsline 6 | \gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} 7 | \global\let\oldnewlabel\newlabel 8 | \gdef\newlabel#1#2{\newlabelxx{#1}#2} 9 | \gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} 10 | \AtEndDocument{\ifx\hyper@anchor\@undefined 11 | \let\contentsline\oldcontentsline 12 | \let\newlabel\oldnewlabel 13 | \fi} 14 | \fi} 15 | \global\let\hyper@last\relax 16 | \gdef\HyperFirstAtBeginDocument#1{#1} 17 | \providecommand*\HyPL@Entry[1]{} 18 | \HyPL@Entry{0<>} 19 | \@writefile{toc}{\contentsline {section}{Problem 1}{2}{section*.1}\protected@file@percent } 20 | \@writefile{toc}{\contentsline {section}{Problem 2}{2}{section*.2}\protected@file@percent } 21 | \@writefile{toc}{\contentsline {section}{Problem 3}{3}{section*.3}\protected@file@percent } 22 | \@writefile{toc}{\contentsline {section}{Problem 4}{3}{section*.4}\protected@file@percent } 23 | \@writefile{toc}{\contentsline {section}{Problem 5}{4}{section*.5}\protected@file@percent } 24 | \@writefile{toc}{\contentsline {section}{Problem 6}{4}{section*.6}\protected@file@percent } 25 | \@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces P-NP-NPC-NPH问题关系图\relax }}{4}{figure.caption.7}\protected@file@percent } 26 | \providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}} 27 | \newlabel{fig:P-NP-NPC-NPH问题关系图}{{1}{4}{P-NP-NPC-NPH问题关系图\relax }{figure.caption.7}{}} 28 | \@writefile{toc}{\contentsline {section}{Problem 7}{4}{section*.8}\protected@file@percent } 29 | \bibstyle{unsrt} 30 | \bibdata{refs} 31 | \@writefile{toc}{\contentsline {section}{Problem 8}{5}{section*.9}\protected@file@percent } 32 | \gdef \@abspage@last{5} 33 | -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap8/homework.listing: -------------------------------------------------------------------------------- 1 | int index = max_element(dp.begin(), dp.end()) - dp.begin(); //最大值对应的索引 2 | int MaxLen = dp[index]; //整除子集的最大长度值 3 | vector res; //注意整个数组的最大整除子集是以nums[index]为结尾的! 4 | while (res.size() != MaxLen) { 5 | res.push_back(nums[index]); 6 | index = m[index]; //逐步地从后往前回溯索引, 并将对应元素写进res数组 7 | } 8 | reverse(res.begin(), res.end()); //reverse一下更好看一些, 此步可以选择注释掉 9 | return res; 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap8/homework.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [1][-]{section*.1}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001}{}% 1 2 | \BOOKMARK [1][-]{section*.2}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0002}{}% 2 3 | \BOOKMARK [1][-]{section*.3}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0003}{}% 3 4 | \BOOKMARK [1][-]{section*.4}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0004}{}% 4 5 | \BOOKMARK [1][-]{section*.5}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0005}{}% 5 6 | \BOOKMARK [1][-]{section*.6}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0006}{}% 6 7 | \BOOKMARK [1][-]{section*.8}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0007}{}% 7 8 | \BOOKMARK [1][-]{section*.9}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0008}{}% 8 9 | -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap8/homework.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap8/homework.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap8/homework.synctex.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap8/homework.synctex.gz -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap8/images/title/Cyber.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap8/images/title/Cyber.jpg -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap8/images/title/P-NP-NPC-NPH问题关系图.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap8/images/title/P-NP-NPC-NPH问题关系图.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap8/images/title/ucas-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap8/images/title/ucas-logo.png -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap8/images/title/ucas_logo 1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap8/images/title/ucas_logo 1.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap8/计算机算法设计与分析-Chap8作业-整合版.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap8/计算机算法设计与分析-Chap8作业-整合版.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap9&10&11/homework.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | \providecommand\hyper@newdestlabel[2]{} 3 | \providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} 4 | \HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined 5 | \global\let\oldcontentsline\contentsline 6 | \gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} 7 | \global\let\oldnewlabel\newlabel 8 | \gdef\newlabel#1#2{\newlabelxx{#1}#2} 9 | \gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} 10 | \AtEndDocument{\ifx\hyper@anchor\@undefined 11 | \let\contentsline\oldcontentsline 12 | \let\newlabel\oldnewlabel 13 | \fi} 14 | \fi} 15 | \global\let\hyper@last\relax 16 | \gdef\HyperFirstAtBeginDocument#1{#1} 17 | \providecommand*\HyPL@Entry[1]{} 18 | \HyPL@Entry{0<>} 19 | \@writefile{toc}{\contentsline {section}{Problem 1}{2}{section*.1}\protected@file@percent } 20 | \@writefile{toc}{\contentsline {section}{Problem 2}{2}{section*.2}\protected@file@percent } 21 | \@writefile{toc}{\contentsline {section}{Problem 3}{3}{section*.3}\protected@file@percent } 22 | \@writefile{toc}{\contentsline {section}{Problem 4}{3}{section*.4}\protected@file@percent } 23 | \@writefile{toc}{\contentsline {section}{Problem 5}{3}{section*.5}\protected@file@percent } 24 | \@writefile{toc}{\contentsline {section}{Problem 6}{4}{section*.6}\protected@file@percent } 25 | \@writefile{loa}{\contentsline {algorithm}{\numberline {1}{\ignorespaces 禁忌搜索算法步骤\relax }}{4}{algorithm.1}\protected@file@percent } 26 | \providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}} 27 | \newlabel{alg:jinji}{{1}{4}{禁忌搜索算法步骤\relax }{algorithm.1}{}} 28 | \@writefile{toc}{\contentsline {section}{Problem 7}{4}{section*.7}\protected@file@percent } 29 | \@writefile{toc}{\contentsline {section}{Problem 8}{4}{section*.8}\protected@file@percent } 30 | \@writefile{toc}{\contentsline {section}{Problem 9}{4}{section*.9}\protected@file@percent } 31 | \@writefile{loa}{\contentsline {algorithm}{\numberline {2}{\ignorespaces 模拟退火算法步骤\relax }}{5}{algorithm.2}\protected@file@percent } 32 | \newlabel{alg:moni}{{2}{5}{模拟退火算法步骤\relax }{algorithm.2}{}} 33 | \@writefile{toc}{\contentsline {section}{Problem 10}{5}{section*.10}\protected@file@percent } 34 | \@writefile{loa}{\contentsline {algorithm}{\numberline {3}{\ignorespaces 遗传算法步骤\relax }}{5}{algorithm.3}\protected@file@percent } 35 | \newlabel{alg:yichuan}{{3}{5}{遗传算法步骤\relax }{algorithm.3}{}} 36 | \@writefile{toc}{\contentsline {section}{Problem 11}{5}{section*.11}\protected@file@percent } 37 | \@writefile{toc}{\contentsline {section}{Problem 12}{5}{section*.12}\protected@file@percent } 38 | \@writefile{toc}{\contentsline {section}{Problem 13}{6}{section*.13}\protected@file@percent } 39 | \@writefile{toc}{\contentsline {section}{Problem 14}{6}{section*.14}\protected@file@percent } 40 | \@writefile{toc}{\contentsline {section}{Problem 15}{6}{section*.15}\protected@file@percent } 41 | \@writefile{toc}{\contentsline {section}{Problem 16}{6}{section*.16}\protected@file@percent } 42 | \@writefile{toc}{\contentsline {section}{Problem 17}{6}{section*.17}\protected@file@percent } 43 | \@writefile{toc}{\contentsline {section}{Problem 18}{7}{section*.18}\protected@file@percent } 44 | \@writefile{loa}{\contentsline {algorithm}{\numberline {4}{\ignorespaces 算法\textbf {MVC}$(G)$\relax }}{7}{algorithm.4}\protected@file@percent } 45 | \newlabel{alg:MVC}{{4}{7}{算法\textbf {MVC}$(G)$\relax }{algorithm.4}{}} 46 | \bibstyle{unsrt} 47 | \bibdata{refs} 48 | \@writefile{toc}{\contentsline {section}{Problem 19}{8}{section*.19}\protected@file@percent } 49 | \gdef \@abspage@last{8} 50 | -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap9&10&11/homework.listing: -------------------------------------------------------------------------------- 1 | int random_pick(vector> nums_probs) { 2 | int res; 3 | random_device rd; //定义一个非确定性的真随机生成器 4 | uniform_real_distribution U(0, 1); //随机数分布对象 5 | double x = U(rd); //在[0,1)内随机选取实数作为x 6 | double cumu_prob = 0.0; //初始化累积概率 7 | for(auto num_prob : nums_probs) { 8 | cumu_prob += num_prob.second; 9 | if(x < cumu_prob) { 10 | res = num_prob.first; 11 | break; 12 | } 13 | } 14 | return res; 15 | } 16 | -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap9&10&11/homework.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [1][-]{section*.1}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001}{}% 1 2 | \BOOKMARK [1][-]{section*.2}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0002}{}% 2 3 | \BOOKMARK [1][-]{section*.3}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0003}{}% 3 4 | \BOOKMARK [1][-]{section*.4}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0004}{}% 4 5 | \BOOKMARK [1][-]{section*.5}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0005}{}% 5 6 | \BOOKMARK [1][-]{section*.6}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0006}{}% 6 7 | \BOOKMARK [1][-]{section*.7}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0007}{}% 7 8 | \BOOKMARK [1][-]{section*.8}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0008}{}% 8 9 | \BOOKMARK [1][-]{section*.9}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0009}{}% 9 10 | \BOOKMARK [1][-]{section*.10}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0000}{}% 10 11 | \BOOKMARK [1][-]{section*.11}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0001}{}% 11 12 | \BOOKMARK [1][-]{section*.12}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0002}{}% 12 13 | \BOOKMARK [1][-]{section*.13}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0003}{}% 13 14 | \BOOKMARK [1][-]{section*.14}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0004}{}% 14 15 | \BOOKMARK [1][-]{section*.15}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0005}{}% 15 16 | \BOOKMARK [1][-]{section*.16}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0006}{}% 16 17 | \BOOKMARK [1][-]{section*.17}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0007}{}% 17 18 | \BOOKMARK [1][-]{section*.18}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0008}{}% 18 19 | \BOOKMARK [1][-]{section*.19}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0009}{}% 19 20 | -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap9&10&11/homework.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap9&10&11/homework.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap9&10&11/homework.synctex.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap9&10&11/homework.synctex.gz -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap9&10&11/images/title/Cyber.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap9&10&11/images/title/Cyber.jpg -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap9&10&11/images/title/P-NP-NPC-NPH问题关系图.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap9&10&11/images/title/P-NP-NPC-NPH问题关系图.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap9&10&11/images/title/ucas-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap9&10&11/images/title/ucas-logo.png -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap9&10&11/images/title/ucas_logo 1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap9&10&11/images/title/ucas_logo 1.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap9&10&11/images/title/补充练习.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap9&10&11/images/title/补充练习.png -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap9&10&11/计算机算法设计与分析-Chap9&10&11作业-整合版.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/UCAS-Algorithm-design-Homework-Chap9&10&11/计算机算法设计与分析-Chap9&10&11作业-整合版.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/计算机算法设计与分析-Chap1&2作业-整合版.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/计算机算法设计与分析-Chap1&2作业-整合版.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/计算机算法设计与分析-Chap3作业-整合版.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/计算机算法设计与分析-Chap3作业-整合版.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/计算机算法设计与分析-Chap4作业-整合版.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/计算机算法设计与分析-Chap4作业-整合版.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/计算机算法设计与分析-Chap5作业-整合版.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/计算机算法设计与分析-Chap5作业-整合版.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/计算机算法设计与分析-Chap6&7作业-整合版.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/计算机算法设计与分析-Chap6&7作业-整合版.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/计算机算法设计与分析-Chap8作业-整合版.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/计算机算法设计与分析-Chap8作业-整合版.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-期末复习版/计算机算法设计与分析-Chap9&10&11作业-整合版.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-期末复习版/计算机算法设计与分析-Chap9&10&11作业-整合版.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap1&2/homework.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | \providecommand\hyper@newdestlabel[2]{} 3 | \providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} 4 | \HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined 5 | \global\let\oldcontentsline\contentsline 6 | \gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} 7 | \global\let\oldnewlabel\newlabel 8 | \gdef\newlabel#1#2{\newlabelxx{#1}#2} 9 | \gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} 10 | \AtEndDocument{\ifx\hyper@anchor\@undefined 11 | \let\contentsline\oldcontentsline 12 | \let\newlabel\oldnewlabel 13 | \fi} 14 | \fi} 15 | \global\let\hyper@last\relax 16 | \gdef\HyperFirstAtBeginDocument#1{#1} 17 | \providecommand*\HyPL@Entry[1]{} 18 | \HyPL@Entry{0<>} 19 | \@writefile{toc}{\contentsline {section}{Problem 1}{2}{section*.1}\protected@file@percent } 20 | \@writefile{toc}{\contentsline {section}{Problem 2}{3}{section*.2}\protected@file@percent } 21 | \@writefile{toc}{\contentsline {section}{Problem 3}{4}{section*.3}\protected@file@percent } 22 | \@writefile{toc}{\contentsline {section}{Problem 4}{4}{section*.4}\protected@file@percent } 23 | \@writefile{toc}{\contentsline {section}{Problem 5}{4}{section*.5}\protected@file@percent } 24 | \@writefile{toc}{\contentsline {section}{Problem 6}{5}{section*.6}\protected@file@percent } 25 | \@writefile{toc}{\contentsline {section}{Problem 7}{6}{section*.7}\protected@file@percent } 26 | \@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces 一个无向图$G$\relax }}{6}{figure.caption.8}\protected@file@percent } 27 | \providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}} 28 | \newlabel{fig:无向图G}{{1}{6}{一个无向图$G$\relax }{figure.caption.8}{}} 29 | \@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces 出入栈模拟\relax }}{6}{figure.caption.9}\protected@file@percent } 30 | \newlabel{fig:出入栈模拟}{{2}{6}{出入栈模拟\relax }{figure.caption.9}{}} 31 | \@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces 第二步骤的模拟\relax }}{7}{figure.caption.10}\protected@file@percent } 32 | \newlabel{fig:第二步骤的模拟}{{3}{7}{第二步骤的模拟\relax }{figure.caption.10}{}} 33 | \@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces 第三步骤的模拟\relax }}{7}{figure.caption.11}\protected@file@percent } 34 | \newlabel{fig:第三步骤的模拟}{{4}{7}{第三步骤的模拟\relax }{figure.caption.11}{}} 35 | \@writefile{toc}{\contentsline {section}{Problem 8}{8}{section*.12}\protected@file@percent } 36 | \@writefile{loa}{\contentsline {algorithm}{\numberline {1}{\ignorespaces 选择排序\relax }}{8}{algorithm.1}\protected@file@percent } 37 | \newlabel{alg:选择排序}{{1}{8}{选择排序\relax }{algorithm.1}{}} 38 | \@writefile{toc}{\contentsline {section}{Problem 9}{8}{section*.13}\protected@file@percent } 39 | \@writefile{toc}{\contentsline {section}{Problem 10}{9}{section*.14}\protected@file@percent } 40 | \@writefile{lot}{\contentsline {table}{\numberline {1}{\ignorespaces 原始表格\relax }}{9}{table.caption.15}\protected@file@percent } 41 | \newlabel{原始表格}{{1}{9}{原始表格\relax }{table.caption.15}{}} 42 | \@writefile{lot}{\contentsline {table}{\numberline {2}{\ignorespaces 解答\relax }}{9}{table.caption.16}\protected@file@percent } 43 | \newlabel{解答}{{2}{9}{解答\relax }{table.caption.16}{}} 44 | \bibstyle{unsrt} 45 | \bibdata{refs} 46 | \@writefile{toc}{\contentsline {section}{Problem 11}{10}{section*.17}\protected@file@percent } 47 | \newlabel{fig:ucas-logo}{{\caption@xref {fig:ucas-logo}{ on input line 486}}{10}{}{figure.caption.18}{}} 48 | \gdef \@abspage@last{10} 49 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap1&2/homework.listing: -------------------------------------------------------------------------------- 1 | /*找最大最小元素 (方法二)*/ 2 | template 3 | bool MinMax(T a[], int n, int& Min, int& Max) { 4 | //寻找a[0:n-1]中的最小元素与最大元素 5 | //如果数组中的元素数目小于1, 则返回false 6 | if(n<1) return false; 7 | Min=Max=0; //初始化 8 | for(int i=1; ia[i]) Min=i; 10 | else if(a[Max]& nums) { 5 | count = 0; 6 | MergeSort(nums, 0, nums.size() - 1); 7 | return count; 8 | } 9 | 10 | void Merge(vector& nums, int low , int mid, int high) { 11 | int i = low, j = mid + 1, k = 0; 12 | vector temp(high - low + 1); 13 | while(i <= mid && j <= high) { 14 | if(nums[i] <= nums[j]) 15 | temp[k++] = nums[i++]; //此情形下逆序数没有增量 16 | else { 17 | temp[k++] = nums[j++]; 18 | count += mid - i + 1; //此情形下逆序数才能有增量 19 | } 20 | } 21 | while(i <= mid) temp[k++] = nums[i++]; //把剩下的nums左半数组接上 22 | while(j <= high) temp[k++] = nums[j++]; //把剩下的nums右半数组接上 23 | copy(temp.begin(), temp.end(), nums.begin() + low); //把临时数组的元素拷贝回nums 24 | vector().swap(temp); //清除容器并最小化它的容量 25 | } 26 | 27 | void MergeSort(vector& nums, int low, int high) { 28 | if(low < high) { 29 | int mid = (low + high) >> 1; 30 | MergeSort(nums, low, mid); 31 | MergeSort(nums, mid + 1, high); 32 | Merge(nums, low, mid, high); 33 | } 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/homework.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [1][-]{section*.1}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001}{}% 1 2 | \BOOKMARK [1][-]{section*.2}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0002}{}% 2 3 | \BOOKMARK [1][-]{section*.3}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0003}{}% 3 4 | \BOOKMARK [1][-]{section*.4}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0004}{}% 4 5 | \BOOKMARK [1][-]{section*.5}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0005}{}% 5 6 | \BOOKMARK [1][-]{section*.6}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0006}{}% 6 7 | \BOOKMARK [1][-]{section*.7}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0007}{}% 7 8 | \BOOKMARK [1][-]{section*.9}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0008}{}% 8 9 | \BOOKMARK [1][-]{section*.10}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0009}{}% 9 10 | \BOOKMARK [1][-]{section*.11}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0000}{}% 10 11 | \BOOKMARK [1][-]{section*.12}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0001}{}% 11 12 | \BOOKMARK [1][-]{section*.13}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0002}{}% 12 13 | \BOOKMARK [1][-]{section*.14}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0003}{}% 13 14 | \BOOKMARK [1][-]{section*.17}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0004}{}% 14 15 | \BOOKMARK [1][-]{section*.18}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0005}{}% 15 16 | \BOOKMARK [1][-]{section*.19}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0006}{}% 16 17 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/homework.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/homework.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/homework.synctex.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/homework.synctex.gz -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/images/title/2-连通分支.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/images/title/2-连通分支.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/images/title/Cyber.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/images/title/Cyber.jpg -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/images/title/ucas-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/images/title/ucas-logo.png -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/images/title/ucas_logo 1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/images/title/ucas_logo 1.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/images/title/汉诺塔问题.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/images/title/汉诺塔问题.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/images/title/递归树1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/images/title/递归树1.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/images/title/递归树2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/images/title/递归树2.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/images/title/递归树3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/images/title/递归树3.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/计算机算法设计与分析-Chap3作业-周胤昌.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap3/计算机算法设计与分析-Chap3作业-周胤昌.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap4/homework.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | \providecommand\hyper@newdestlabel[2]{} 3 | \providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} 4 | \HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined 5 | \global\let\oldcontentsline\contentsline 6 | \gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} 7 | \global\let\oldnewlabel\newlabel 8 | \gdef\newlabel#1#2{\newlabelxx{#1}#2} 9 | \gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} 10 | \AtEndDocument{\ifx\hyper@anchor\@undefined 11 | \let\contentsline\oldcontentsline 12 | \let\newlabel\oldnewlabel 13 | \fi} 14 | \fi} 15 | \global\let\hyper@last\relax 16 | \gdef\HyperFirstAtBeginDocument#1{#1} 17 | \providecommand*\HyPL@Entry[1]{} 18 | \HyPL@Entry{0<>} 19 | \@writefile{toc}{\contentsline {section}{Problem 1}{2}{section*.1}\protected@file@percent } 20 | \@writefile{loa}{\contentsline {algorithm}{\numberline {1}{\ignorespaces \textbf {Service}算法\relax }}{2}{algorithm.1}\protected@file@percent } 21 | \providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}} 22 | \newlabel{alg:Service}{{1}{2}{\textbf {Service}算法\relax }{algorithm.1}{}} 23 | \@writefile{toc}{\contentsline {section}{Problem 2}{3}{section*.2}\protected@file@percent } 24 | \@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Huffman树\relax }}{3}{figure.caption.3}\protected@file@percent } 25 | \newlabel{fig:Huffman树}{{1}{3}{Huffman树\relax }{figure.caption.3}{}} 26 | \newlabel{inequ1}{{5}{3}{Problem \arabic {homeworkProblemCounter}}{equation.0.5}{}} 27 | \@writefile{toc}{\contentsline {section}{Problem 3}{4}{section*.4}\protected@file@percent } 28 | \@writefile{toc}{\contentsline {section}{Problem 4}{5}{section*.5}\protected@file@percent } 29 | \@writefile{loa}{\contentsline {algorithm}{\numberline {2}{\ignorespaces \textbf {HuffmanCode}算法\relax }}{5}{algorithm.2}\protected@file@percent } 30 | \newlabel{alg:HuffmanCode}{{2}{5}{\textbf {HuffmanCode}算法\relax }{algorithm.2}{}} 31 | \@writefile{toc}{\contentsline {section}{Problem 5}{9}{section*.6}\protected@file@percent } 32 | \@writefile{loa}{\contentsline {algorithm}{\numberline {3}{\ignorespaces \textbf {Location}算法\relax }}{9}{algorithm.3}\protected@file@percent } 33 | \newlabel{alg:Location}{{3}{9}{\textbf {Location}算法\relax }{algorithm.3}{}} 34 | \@writefile{toc}{\contentsline {section}{Problem 6}{10}{section*.7}\protected@file@percent } 35 | \@writefile{loa}{\contentsline {algorithm}{\numberline {4}{\ignorespaces \textbf {Test}算法\relax }}{10}{algorithm.4}\protected@file@percent } 36 | \newlabel{alg:Test}{{4}{10}{\textbf {Test}算法\relax }{algorithm.4}{}} 37 | \@writefile{toc}{\contentsline {section}{Problem 7}{11}{section*.8}\protected@file@percent } 38 | \@writefile{loa}{\contentsline {algorithm}{\numberline {5}{\ignorespaces \textbf {Work}算法\relax }}{11}{algorithm.5}\protected@file@percent } 39 | \newlabel{alg:Work}{{5}{11}{\textbf {Work}算法\relax }{algorithm.5}{}} 40 | \bibstyle{unsrt} 41 | \bibdata{refs} 42 | \@writefile{toc}{\contentsline {section}{Problem 8}{12}{section*.9}\protected@file@percent } 43 | \newlabel{fig:ucas-logo}{{\caption@xref {fig:ucas-logo}{ on input line 596}}{12}{}{figure.caption.10}{}} 44 | \gdef \@abspage@last{12} 45 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap4/homework.listing: -------------------------------------------------------------------------------- 1 | string Huff_Decode(Node huffTree[], int n,string s) 2 | { 3 | cout << "解码后为: "; 4 | string temp = "", str = "";//保存解码后的字符串 5 | for (int i = 0; i < s.size(); i++) 6 | { 7 | temp = temp + s[i]; 8 | for (int j = 0; j < n; j++) 9 | { 10 | if (temp == huffTree[j].code) 11 | { 12 | str = str + huffTree[j].ch; 13 | temp = ""; 14 | break; 15 | } 16 | else if (i == s.size()-1 && j == n-1 && temp != "")//全部遍历后没有 17 | { 18 | str = "解码错误!"; 19 | } 20 | } 21 | } 22 | return str; 23 | } 24 | 25 | int main() 26 | { 27 | //编码过程 28 | const int n = 5; 29 | Node huffTree[2 * n]; 30 | string str[] = { "A", "B", "C", "D", "E"}; 31 | int w[] = { 30, 30, 5, 20, 15 }; 32 | Huff_Tree(huffTree, w, str, n); 33 | Huff_Code(huffTree, n); 34 | //解码过程 35 | string s; 36 | cout << "输入编码:"; 37 | cin >> s; 38 | cout << Huff_Decode(huffTree, n, s) << endl; 39 | system("pause"); 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap4/homework.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [1][-]{section*.1}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001}{}% 1 2 | \BOOKMARK [1][-]{section*.2}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0002}{}% 2 3 | \BOOKMARK [1][-]{section*.4}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0003}{}% 3 4 | \BOOKMARK [1][-]{section*.5}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0004}{}% 4 5 | \BOOKMARK [1][-]{section*.6}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0005}{}% 5 6 | \BOOKMARK [1][-]{section*.7}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0006}{}% 6 7 | \BOOKMARK [1][-]{section*.8}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0007}{}% 7 8 | \BOOKMARK [1][-]{section*.9}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0008}{}% 8 9 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap4/homework.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap4/homework.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap4/homework.synctex.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap4/homework.synctex.gz -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap4/images/title/Cyber.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap4/images/title/Cyber.jpg -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap4/images/title/Huffman树.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap4/images/title/Huffman树.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap4/images/title/ucas-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap4/images/title/ucas-logo.png -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap4/images/title/ucas_logo 1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap4/images/title/ucas_logo 1.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap4/计算机算法设计与分析-Chap4作业-周胤昌.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap4/计算机算法设计与分析-Chap4作业-周胤昌.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap5/homework.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | \providecommand\hyper@newdestlabel[2]{} 3 | \providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} 4 | \HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined 5 | \global\let\oldcontentsline\contentsline 6 | \gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} 7 | \global\let\oldnewlabel\newlabel 8 | \gdef\newlabel#1#2{\newlabelxx{#1}#2} 9 | \gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} 10 | \AtEndDocument{\ifx\hyper@anchor\@undefined 11 | \let\contentsline\oldcontentsline 12 | \let\newlabel\oldnewlabel 13 | \fi} 14 | \fi} 15 | \global\let\hyper@last\relax 16 | \gdef\HyperFirstAtBeginDocument#1{#1} 17 | \providecommand*\HyPL@Entry[1]{} 18 | \HyPL@Entry{0<>} 19 | \@writefile{toc}{\contentsline {section}{Problem 1}{2}{section*.1}\protected@file@percent } 20 | \@writefile{toc}{\contentsline {section}{Problem 2}{5}{section*.2}\protected@file@percent } 21 | \@writefile{toc}{\contentsline {section}{Problem 3}{8}{section*.3}\protected@file@percent } 22 | \@writefile{toc}{\contentsline {section}{Problem 4}{9}{section*.4}\protected@file@percent } 23 | \@writefile{toc}{\contentsline {section}{Problem 5}{10}{section*.5}\protected@file@percent } 24 | \@writefile{toc}{\contentsline {section}{Problem 6}{14}{section*.6}\protected@file@percent } 25 | \@writefile{loa}{\contentsline {algorithm}{\numberline {1}{\ignorespaces \textbf {Homework}算法\relax }}{15}{algorithm.1}\protected@file@percent } 26 | \providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}} 27 | \newlabel{alg:Homework}{{1}{15}{\textbf {Homework}算法\relax }{algorithm.1}{}} 28 | \@writefile{toc}{\contentsline {section}{Problem 7}{15}{section*.7}\protected@file@percent } 29 | \@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces 5边形的划分方案\relax }}{15}{figure.caption.8}\protected@file@percent } 30 | \newlabel{fig:5边形的划分方案}{{1}{15}{5边形的划分方案\relax }{figure.caption.8}{}} 31 | \bibstyle{unsrt} 32 | \bibdata{refs} 33 | \@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces 子问题归约图\relax }}{16}{figure.caption.9}\protected@file@percent } 34 | \newlabel{fig:子问题归约}{{2}{16}{子问题归约图\relax }{figure.caption.9}{}} 35 | \newlabel{fig:ucas-logo}{{\caption@xref {fig:ucas-logo}{ on input line 666}}{16}{}{figure.caption.10}{}} 36 | \gdef \@abspage@last{16} 37 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap5/homework.listing: -------------------------------------------------------------------------------- 1 | int index = max_element(dp.begin(), dp.end()) - dp.begin(); //最大值对应的索引 2 | int MaxLen = dp[index]; //整除子集的最大长度值 3 | vector res; //注意整个数组的最大整除子集是以nums[index]为结尾的! 4 | while (res.size() != MaxLen) { 5 | res.push_back(nums[index]); 6 | index = m[index]; //逐步地从后往前回溯索引, 并将对应元素写进res数组 7 | } 8 | reverse(res.begin(), res.end()); //reverse一下更好看一些, 此步可以选择注释掉 9 | return res; 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap5/homework.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [1][-]{section*.1}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001}{}% 1 2 | \BOOKMARK [1][-]{section*.2}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0002}{}% 2 3 | \BOOKMARK [1][-]{section*.3}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0003}{}% 3 4 | \BOOKMARK [1][-]{section*.4}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0004}{}% 4 5 | \BOOKMARK [1][-]{section*.5}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0005}{}% 5 6 | \BOOKMARK [1][-]{section*.6}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0006}{}% 6 7 | \BOOKMARK [1][-]{section*.7}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0007}{}% 7 8 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap5/homework.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap5/homework.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap5/homework.synctex.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap5/homework.synctex.gz -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap5/images/title/5边形的划分方案.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap5/images/title/5边形的划分方案.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap5/images/title/Cyber.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap5/images/title/Cyber.jpg -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap5/images/title/ucas-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap5/images/title/ucas-logo.png -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap5/images/title/ucas_logo 1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap5/images/title/ucas_logo 1.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap5/images/title/子问题归约.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap5/images/title/子问题归约.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap5/计算机算法设计与分析-Chap5作业-周胤昌.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap5/计算机算法设计与分析-Chap5作业-周胤昌.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/homework.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | \providecommand\hyper@newdestlabel[2]{} 3 | \providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} 4 | \HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined 5 | \global\let\oldcontentsline\contentsline 6 | \gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} 7 | \global\let\oldnewlabel\newlabel 8 | \gdef\newlabel#1#2{\newlabelxx{#1}#2} 9 | \gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} 10 | \AtEndDocument{\ifx\hyper@anchor\@undefined 11 | \let\contentsline\oldcontentsline 12 | \let\newlabel\oldnewlabel 13 | \fi} 14 | \fi} 15 | \global\let\hyper@last\relax 16 | \gdef\HyperFirstAtBeginDocument#1{#1} 17 | \providecommand*\HyPL@Entry[1]{} 18 | \HyPL@Entry{0<>} 19 | \@writefile{toc}{\contentsline {section}{Problem 1}{2}{section*.1}\protected@file@percent } 20 | \@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces 旅行商问题\relax }}{2}{figure.caption.2}\protected@file@percent } 21 | \providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}} 22 | \newlabel{fig:旅行商问题}{{1}{2}{旅行商问题\relax }{figure.caption.2}{}} 23 | \@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces 解空间树搜索图\relax }}{2}{figure.caption.3}\protected@file@percent } 24 | \newlabel{fig:解空间树搜索图}{{2}{2}{解空间树搜索图\relax }{figure.caption.3}{}} 25 | \@writefile{toc}{\contentsline {section}{Problem 2}{3}{section*.4}\protected@file@percent } 26 | \@writefile{toc}{\contentsline {section}{Problem 3}{3}{section*.5}\protected@file@percent } 27 | \bibstyle{unsrt} 28 | \bibdata{refs} 29 | \@writefile{toc}{\contentsline {section}{Problem 4}{4}{section*.6}\protected@file@percent } 30 | \@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces Latin方\relax }}{4}{figure.caption.7}\protected@file@percent } 31 | \newlabel{fig:Latin方}{{3}{4}{Latin方\relax }{figure.caption.7}{}} 32 | \@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces Latin方结果\relax }}{4}{figure.caption.8}\protected@file@percent } 33 | \newlabel{fig:Latin方结果}{{4}{4}{Latin方结果\relax }{figure.caption.8}{}} 34 | \gdef \@abspage@last{4} 35 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/homework.listing: -------------------------------------------------------------------------------- 1 | int index = max_element(dp.begin(), dp.end()) - dp.begin(); //最大值对应的索引 2 | int MaxLen = dp[index]; //整除子集的最大长度值 3 | vector res; //注意整个数组的最大整除子集是以nums[index]为结尾的! 4 | while (res.size() != MaxLen) { 5 | res.push_back(nums[index]); 6 | index = m[index]; //逐步地从后往前回溯索引, 并将对应元素写进res数组 7 | } 8 | reverse(res.begin(), res.end()); //reverse一下更好看一些, 此步可以选择注释掉 9 | return res; 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/homework.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [1][-]{section*.1}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001}{}% 1 2 | \BOOKMARK [1][-]{section*.4}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0002}{}% 2 3 | \BOOKMARK [1][-]{section*.5}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0003}{}% 3 4 | \BOOKMARK [1][-]{section*.6}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0004}{}% 4 5 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/homework.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/homework.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/homework.synctex.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/homework.synctex.gz -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/Cyber.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/Cyber.jpg -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/Latin方.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/Latin方.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/Latin方结果.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/Latin方结果.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/ucas-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/ucas-logo.png -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/ucas_logo 1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/ucas_logo 1.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/旅行商问题.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/旅行商问题.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/解空间树搜索图.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/images/title/解空间树搜索图.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/计算机算法设计与分析-Chap6&7作业-周胤昌.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap6&7/计算机算法设计与分析-Chap6&7作业-周胤昌.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap8/homework.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | \providecommand\hyper@newdestlabel[2]{} 3 | \providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} 4 | \HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined 5 | \global\let\oldcontentsline\contentsline 6 | \gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} 7 | \global\let\oldnewlabel\newlabel 8 | \gdef\newlabel#1#2{\newlabelxx{#1}#2} 9 | \gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} 10 | \AtEndDocument{\ifx\hyper@anchor\@undefined 11 | \let\contentsline\oldcontentsline 12 | \let\newlabel\oldnewlabel 13 | \fi} 14 | \fi} 15 | \global\let\hyper@last\relax 16 | \gdef\HyperFirstAtBeginDocument#1{#1} 17 | \providecommand*\HyPL@Entry[1]{} 18 | \HyPL@Entry{0<>} 19 | \@writefile{toc}{\contentsline {section}{Problem 1}{2}{section*.1}\protected@file@percent } 20 | \newlabel{eq:2}{{{2}}{2}{Problem \arabic {homeworkProblemCounter}}{AMS.5}{}} 21 | \@writefile{toc}{\contentsline {section}{Problem 2}{3}{section*.6}\protected@file@percent } 22 | \@writefile{toc}{\contentsline {section}{Problem 3}{3}{section*.7}\protected@file@percent } 23 | \@writefile{toc}{\contentsline {section}{Problem 4}{4}{section*.8}\protected@file@percent } 24 | \@writefile{toc}{\contentsline {section}{Problem 5}{4}{section*.9}\protected@file@percent } 25 | \@writefile{toc}{\contentsline {section}{Problem 6}{5}{section*.10}\protected@file@percent } 26 | \@writefile{toc}{\contentsline {section}{Problem 7}{5}{section*.11}\protected@file@percent } 27 | \@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces P-NP-NPC-NPH问题关系图\relax }}{5}{figure.caption.12}\protected@file@percent } 28 | \providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}} 29 | \newlabel{fig:P-NP-NPC-NPH问题关系图}{{1}{5}{P-NP-NPC-NPH问题关系图\relax }{figure.caption.12}{}} 30 | \bibstyle{unsrt} 31 | \bibdata{refs} 32 | \@writefile{toc}{\contentsline {section}{Problem 8}{6}{section*.13}\protected@file@percent } 33 | \@writefile{toc}{\contentsline {section}{Problem 9}{6}{section*.14}\protected@file@percent } 34 | \gdef \@abspage@last{6} 35 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap8/homework.listing: -------------------------------------------------------------------------------- 1 | int index = max_element(dp.begin(), dp.end()) - dp.begin(); //最大值对应的索引 2 | int MaxLen = dp[index]; //整除子集的最大长度值 3 | vector res; //注意整个数组的最大整除子集是以nums[index]为结尾的! 4 | while (res.size() != MaxLen) { 5 | res.push_back(nums[index]); 6 | index = m[index]; //逐步地从后往前回溯索引, 并将对应元素写进res数组 7 | } 8 | reverse(res.begin(), res.end()); //reverse一下更好看一些, 此步可以选择注释掉 9 | return res; 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap8/homework.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [1][-]{section*.1}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001}{}% 1 2 | \BOOKMARK [1][-]{section*.6}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0002}{}% 2 3 | \BOOKMARK [1][-]{section*.7}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0003}{}% 3 4 | \BOOKMARK [1][-]{section*.8}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0004}{}% 4 5 | \BOOKMARK [1][-]{section*.9}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0005}{}% 5 6 | \BOOKMARK [1][-]{section*.10}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0006}{}% 6 7 | \BOOKMARK [1][-]{section*.11}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0007}{}% 7 8 | \BOOKMARK [1][-]{section*.13}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0008}{}% 8 9 | \BOOKMARK [1][-]{section*.14}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0009}{}% 9 10 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap8/homework.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap8/homework.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap8/homework.synctex.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap8/homework.synctex.gz -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap8/images/title/Cyber.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap8/images/title/Cyber.jpg -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap8/images/title/P-NP-NPC-NPH问题关系图.agx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap8/images/title/P-NP-NPC-NPH问题关系图.agx -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap8/images/title/P-NP-NPC-NPH问题关系图.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap8/images/title/P-NP-NPC-NPH问题关系图.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap8/images/title/ucas-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap8/images/title/ucas-logo.png -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap8/images/title/ucas_logo 1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap8/images/title/ucas_logo 1.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap8/计算机算法设计与分析-Chap8作业-周胤昌.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap8/计算机算法设计与分析-Chap8作业-周胤昌.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap9&10&11/homework.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | \providecommand\hyper@newdestlabel[2]{} 3 | \providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} 4 | \HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined 5 | \global\let\oldcontentsline\contentsline 6 | \gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} 7 | \global\let\oldnewlabel\newlabel 8 | \gdef\newlabel#1#2{\newlabelxx{#1}#2} 9 | \gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} 10 | \AtEndDocument{\ifx\hyper@anchor\@undefined 11 | \let\contentsline\oldcontentsline 12 | \let\newlabel\oldnewlabel 13 | \fi} 14 | \fi} 15 | \global\let\hyper@last\relax 16 | \gdef\HyperFirstAtBeginDocument#1{#1} 17 | \providecommand*\HyPL@Entry[1]{} 18 | \HyPL@Entry{0<>} 19 | \@writefile{toc}{\contentsline {section}{Problem 1}{2}{section*.1}\protected@file@percent } 20 | \@writefile{toc}{\contentsline {section}{Problem 2}{3}{section*.2}\protected@file@percent } 21 | \@writefile{toc}{\contentsline {section}{Problem 3}{4}{section*.3}\protected@file@percent } 22 | \@writefile{toc}{\contentsline {section}{Problem 4}{12}{section*.4}\protected@file@percent } 23 | \@writefile{toc}{\contentsline {section}{Problem 5}{12}{section*.5}\protected@file@percent } 24 | \@writefile{toc}{\contentsline {section}{Problem 6}{12}{section*.6}\protected@file@percent } 25 | \@writefile{toc}{\contentsline {section}{Problem 7}{13}{section*.7}\protected@file@percent } 26 | \@writefile{toc}{\contentsline {section}{Problem 8}{14}{section*.8}\protected@file@percent } 27 | \@writefile{toc}{\contentsline {section}{Problem 9}{14}{section*.9}\protected@file@percent } 28 | \@writefile{toc}{\contentsline {section}{Problem 10}{15}{section*.10}\protected@file@percent } 29 | \@writefile{loa}{\contentsline {algorithm}{\numberline {1}{\ignorespaces \textbf {DP}算法\relax }}{15}{algorithm.1}\protected@file@percent } 30 | \providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}} 31 | \newlabel{alg:DP}{{1}{15}{\textbf {DP}算法\relax }{algorithm.1}{}} 32 | \@writefile{loa}{\contentsline {algorithm}{\numberline {2}{\ignorespaces \textbf {FPTAS}算法\relax }}{16}{algorithm.2}\protected@file@percent } 33 | \newlabel{alg:FPTAS}{{2}{16}{\textbf {FPTAS}算法\relax }{algorithm.2}{}} 34 | \newlabel{eq:*}{{{$\ast $}}{16}{Problem \arabic {homeworkProblemCounter}}{AMS.12}{}} 35 | \@writefile{toc}{\contentsline {section}{Problem 11}{17}{section*.13}\protected@file@percent } 36 | \@writefile{loa}{\contentsline {algorithm}{\numberline {3}{\ignorespaces 算法\textbf {MVC}$(G)$\relax }}{17}{algorithm.3}\protected@file@percent } 37 | \newlabel{alg:MVC}{{3}{17}{算法\textbf {MVC}$(G)$\relax }{algorithm.3}{}} 38 | \@writefile{toc}{\contentsline {section}{Problem 12}{17}{section*.14}\protected@file@percent } 39 | \@writefile{toc}{\contentsline {section}{Problem 13}{18}{section*.15}\protected@file@percent } 40 | \@writefile{toc}{\contentsline {section}{Problem 14}{18}{section*.16}\protected@file@percent } 41 | \@writefile{toc}{\contentsline {section}{Problem 15}{18}{section*.17}\protected@file@percent } 42 | \@writefile{loa}{\contentsline {algorithm}{\numberline {4}{\ignorespaces 禁忌搜索算法步骤\relax }}{18}{algorithm.4}\protected@file@percent } 43 | \newlabel{alg:jinji}{{4}{18}{禁忌搜索算法步骤\relax }{algorithm.4}{}} 44 | \@writefile{toc}{\contentsline {section}{Problem 16}{18}{section*.18}\protected@file@percent } 45 | \@writefile{toc}{\contentsline {section}{Problem 17}{19}{section*.19}\protected@file@percent } 46 | \@writefile{toc}{\contentsline {section}{Problem 18}{19}{section*.20}\protected@file@percent } 47 | \@writefile{loa}{\contentsline {algorithm}{\numberline {5}{\ignorespaces 模拟退火算法步骤\relax }}{19}{algorithm.5}\protected@file@percent } 48 | \newlabel{alg:moni}{{5}{19}{模拟退火算法步骤\relax }{algorithm.5}{}} 49 | \@writefile{toc}{\contentsline {section}{Problem 19}{19}{section*.21}\protected@file@percent } 50 | \@writefile{toc}{\contentsline {section}{Problem 20}{19}{section*.22}\protected@file@percent } 51 | \bibstyle{unsrt} 52 | \bibdata{refs} 53 | \@writefile{toc}{\contentsline {section}{Problem 21}{20}{section*.23}\protected@file@percent } 54 | \@writefile{toc}{\contentsline {section}{Problem 22}{20}{section*.24}\protected@file@percent } 55 | \@writefile{toc}{\contentsline {section}{Problem 23}{20}{section*.25}\protected@file@percent } 56 | \newlabel{fig:ucas-logo}{{\caption@xref {fig:ucas-logo}{ on input line 1019}}{20}{}{figure.caption.26}{}} 57 | \gdef \@abspage@last{20} 58 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap9&10&11/homework.listing: -------------------------------------------------------------------------------- 1 | ---------分支限界算法之布线问题--------- 2 | 在一个m*n的棋盘上, 请分别输入m和n, 代表行数和列数, 然后输入回车 3 | 10 10 4 | 布线前的棋盘格 5 | ------------------ 6 | -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 7 | -2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -2 8 | -2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -2 9 | -2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -2 10 | -2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -2 11 | -2 -3 -3 -3 -3 -1 -1 -3 -3 -3 -1 -2 12 | -2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -2 13 | -2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -2 14 | -2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -2 15 | -2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -2 16 | -2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -2 17 | -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 18 | ------------------ 19 | 请输入起点位置坐标 20 | 1 1 21 | 请输入终点位置坐标 22 | 9 9 23 | 24 | 没有找到路线, 第1次尝试 25 | 没有找到路线, 第2次尝试 26 | 没有找到路线, 第3次尝试 27 | 没有找到路线, 第4次尝试 28 | ------------------ 29 | $ 代表围墙 30 | # 代表已经占据的点 31 | * 代表布线路线 32 | = 代表还没有布线的点 33 | ------------------ 34 | $ $ $ $ $ $ $ $ $ $ $ $ 35 | $ * = = = = = = = = = $ 36 | $ * * * = = = = = = = $ 37 | $ = = * * = = = = = = $ 38 | $ = = = * * = = = = = $ 39 | $ # # # # * = # # # = $ 40 | $ = = = = * = = = = = $ 41 | $ = = = = * * * = = = $ 42 | $ = = = = = = * = = = $ 43 | $ = = = = = = * * * = $ 44 | $ = = = = = = = = = = $ 45 | $ $ $ $ $ $ $ $ $ $ $ $ 46 | ------------------ 47 | 路径坐标和长度 48 | (1,1) (2,1) (2,2) (2,3) (3,3) (3,4) (4,4) (4,5) (5,5) (6,5) (7,5) (7,6) (7,7) (8,7) (9,7) (9,8) (9,9) 49 | 路径长度: 17 50 | 布线完毕, 共查找5次 51 | 算法运行时间为: 73ms 52 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap9&10&11/homework.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [1][-]{section*.1}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001}{}% 1 2 | \BOOKMARK [1][-]{section*.2}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0002}{}% 2 3 | \BOOKMARK [1][-]{section*.3}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0003}{}% 3 4 | \BOOKMARK [1][-]{section*.4}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0004}{}% 4 5 | \BOOKMARK [1][-]{section*.5}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0005}{}% 5 6 | \BOOKMARK [1][-]{section*.6}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0006}{}% 6 7 | \BOOKMARK [1][-]{section*.7}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0007}{}% 7 8 | \BOOKMARK [1][-]{section*.8}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0008}{}% 8 9 | \BOOKMARK [1][-]{section*.9}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0009}{}% 9 10 | \BOOKMARK [1][-]{section*.10}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0000}{}% 10 11 | \BOOKMARK [1][-]{section*.13}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0001}{}% 11 12 | \BOOKMARK [1][-]{section*.14}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0002}{}% 12 13 | \BOOKMARK [1][-]{section*.15}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0003}{}% 13 14 | \BOOKMARK [1][-]{section*.16}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0004}{}% 14 15 | \BOOKMARK [1][-]{section*.17}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0005}{}% 15 16 | \BOOKMARK [1][-]{section*.18}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0006}{}% 16 17 | \BOOKMARK [1][-]{section*.19}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0007}{}% 17 18 | \BOOKMARK [1][-]{section*.20}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0008}{}% 18 19 | \BOOKMARK [1][-]{section*.21}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001\0009}{}% 19 20 | \BOOKMARK [1][-]{section*.22}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0002\0000}{}% 20 21 | \BOOKMARK [1][-]{section*.23}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0002\0001}{}% 21 22 | \BOOKMARK [1][-]{section*.24}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0002\0002}{}% 22 23 | \BOOKMARK [1][-]{section*.25}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0002\0003}{}% 23 24 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap9&10&11/homework.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap9&10&11/homework.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap9&10&11/homework.synctex.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap9&10&11/homework.synctex.gz -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap9&10&11/images/title/Cyber.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap9&10&11/images/title/Cyber.jpg -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap9&10&11/images/title/ucas-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap9&10&11/images/title/ucas-logo.png -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap9&10&11/images/title/ucas_logo 1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap9&10&11/images/title/ucas_logo 1.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap9&10&11/计算机算法设计与分析-Chap9&10&11作业-周胤昌.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-Chap9&10&11/计算机算法设计与分析-Chap9&10&11作业-周胤昌.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/homework.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | \providecommand\hyper@newdestlabel[2]{} 3 | \providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} 4 | \HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined 5 | \global\let\oldcontentsline\contentsline 6 | \gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} 7 | \global\let\oldnewlabel\newlabel 8 | \gdef\newlabel#1#2{\newlabelxx{#1}#2} 9 | \gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} 10 | \AtEndDocument{\ifx\hyper@anchor\@undefined 11 | \let\contentsline\oldcontentsline 12 | \let\newlabel\oldnewlabel 13 | \fi} 14 | \fi} 15 | \global\let\hyper@last\relax 16 | \gdef\HyperFirstAtBeginDocument#1{#1} 17 | \providecommand*\HyPL@Entry[1]{} 18 | \HyPL@Entry{0<>} 19 | \@writefile{toc}{\contentsline {section}{Problem 1}{2}{section*.1}\protected@file@percent } 20 | \@writefile{toc}{\contentsline {section}{Problem 2}{10}{section*.2}\protected@file@percent } 21 | \@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces 各次的运行结果\relax }}{13}{figure.caption.3}\protected@file@percent } 22 | \providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}} 23 | \newlabel{fig:taizhous}{{1}{13}{各次的运行结果\relax }{figure.caption.3}{}} 24 | \@writefile{lof}{\contentsline {subfigure}{\numberline{(a)}{\ignorespaces {第1次运行结果}}}{13}{subfigure.1.1}\protected@file@percent } 25 | \@writefile{lof}{\contentsline {subfigure}{\numberline{(b)}{\ignorespaces {第2次运行结果}}}{13}{subfigure.1.2}\protected@file@percent } 26 | \@writefile{lof}{\contentsline {subfigure}{\numberline{(c)}{\ignorespaces {第3次运行结果}}}{13}{subfigure.1.3}\protected@file@percent } 27 | \@writefile{lof}{\contentsline {subfigure}{\numberline{(d)}{\ignorespaces {第4次运行结果}}}{13}{subfigure.1.4}\protected@file@percent } 28 | \@writefile{lof}{\contentsline {subfigure}{\numberline{(e)}{\ignorespaces {第5次运行结果}}}{13}{subfigure.1.5}\protected@file@percent } 29 | \@writefile{lof}{\contentsline {subfigure}{\numberline{(f)}{\ignorespaces {第6次运行结果}}}{13}{subfigure.1.6}\protected@file@percent } 30 | \@writefile{toc}{\contentsline {section}{Problem 3}{14}{section*.4}\protected@file@percent } 31 | \@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces 随机路线图\relax }}{17}{figure.caption.5}\protected@file@percent } 32 | \newlabel{fig:随机路线图}{{2}{17}{随机路线图\relax }{figure.caption.5}{}} 33 | \bibstyle{unsrt} 34 | \bibdata{refs} 35 | \@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces 最优解路线图\relax }}{18}{figure.caption.6}\protected@file@percent } 36 | \newlabel{fig:最优解路线图}{{3}{18}{最优解路线图\relax }{figure.caption.6}{}} 37 | \@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces 模拟退火算法优化过程图\relax }}{18}{figure.caption.7}\protected@file@percent } 38 | \newlabel{fig:模拟退火算法优化过程图}{{4}{18}{模拟退火算法优化过程图\relax }{figure.caption.7}{}} 39 | \newlabel{fig:ucas-logo}{{\caption@xref {fig:ucas-logo}{ on input line 1056}}{18}{}{figure.caption.8}{}} 40 | \gdef \@abspage@last{18} 41 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/homework.listing: -------------------------------------------------------------------------------- 1 | % 2. Metropolis法则判断是否接受新解 2 | [S1 R] = Metropolis(S1, S2, D, T0); % Metropolis抽样算法 3 | temp(k, :) = [S1 R]; % 记录下一路线及其长度 4 | end 5 | %% 3. 记录每次迭代过程的最优路线 6 | [d0, index] = min(temp(:, end)); % 找出当前温度下最优路线 7 | if count == 1 || d0 <= Obj(count-1) 8 | Obj(count) = d0; % 如果当前温度下最优路程小于上一路程则记录当前路程 9 | else 10 | Obj(count) = Obj(count-1); % 如果当前温度下最优路程大于上一路程则记录上一路程 11 | end 12 | track(count, :) = temp(index, 1:end-1); % 记录当前温度的最优路线 13 | %降温 14 | T0 = q * T0; 15 | end 16 | 17 | %% VII. 优化过程迭代图 18 | figure 19 | plot(1:count,Obj) 20 | xlabel('迭代次数') 21 | ylabel('距离') 22 | title('优化过程') 23 | 24 | %% VIII. 绘制最优路径图 25 | DrawPath(track(end,:),X) 26 | 27 | %% IX. 输出最优解的路线和总距离 28 | disp('最优解:') 29 | S = track(end,:); 30 | p = OutputPath(S); 31 | disp(['总距离:',num2str(PathLength(D,S))]); 32 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/homework.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [1][-]{section*.1}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001}{}% 1 2 | \BOOKMARK [1][-]{section*.2}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0002}{}% 2 3 | \BOOKMARK [1][-]{section*.4}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0003}{}% 3 4 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/homework.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/homework.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/homework.synctex.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/homework.synctex.gz -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/Cyber.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/Cyber.jpg -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/sol-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/sol-1.png -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/sol-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/sol-2.png -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/sol-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/sol-3.png -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/sol-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/sol-4.png -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/sol-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/sol-5.png -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/sol-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/sol-6.png -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/ucas-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/ucas-logo.png -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/ucas_logo 1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/ucas_logo 1.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/最优解路线图.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/最优解路线图.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/模拟退火算法优化过程图.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/模拟退火算法优化过程图.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/随机路线图.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/images/title/随机路线图.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/作业代码/TSP模拟退火Matlab代码/Distance.m: -------------------------------------------------------------------------------- 1 | function D = Distance(citys) 2 | %% 计算两两城市之间的距离 3 | % 输入 citys 各城市的位置坐标 4 | % 输出 D 两两城市之间的距离 5 | n = size(citys,1); 6 | D = zeros(n,n); 7 | for i = 1:n 8 | for j = i+1:n 9 | D(i,j) = sqrt(sum((citys(i,:) - citys(j,:)).^2)); 10 | D(j,i) = D(i,j); 11 | end 12 | end -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/作业代码/TSP模拟退火Matlab代码/DrawPath.m: -------------------------------------------------------------------------------- 1 | function DrawPath(Route,citys) 2 | %% 画路径函数 3 | %输入 4 | % Route 待画路径 5 | % citys 各城市坐标位置 6 | 7 | figure 8 | plot([citys(Route,1);citys(Route(1),1)],... 9 | [citys(Route,2);citys(Route(1),2)],'o-'); 10 | grid on 11 | 12 | for i = 1:size(citys,1) 13 | text(citys(i,1),citys(i,2),[' ' num2str(i)]); 14 | end 15 | 16 | text(citys(Route(1),1),citys(Route(1),2),' 起点'); 17 | text(citys(Route(end),1),citys(Route(end),2),' 终点'); 18 | 19 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/作业代码/TSP模拟退火Matlab代码/Metropolis.m: -------------------------------------------------------------------------------- 1 | function [S,R] = Metropolis(S1,S2,D,T) 2 | %% 输入 3 | % S1: 当前解 4 | % S2: 新解 5 | % D: 距离矩阵(两两城市的之间的距离) 6 | % T: 当前温度 7 | %% 输出 8 | % S: 下一个当前解 9 | % R: 下一个当前解的路线距离 10 | R1 = PathLength(D,S1); %计算路线长度 11 | N = length(S1); %得到城市的个数 12 | 13 | R2 = PathLength(D,S2); %计算路线长度 14 | dC = R2 - R1; %计算能力之差 15 | if dC < 0 %如果能力降低 接受新路线 16 | S = S2; 17 | R = R2; 18 | elseif exp(-dC/T) >= rand %以exp(-dC/T)概率接受新路线 19 | S = S2; 20 | R = R2; 21 | else %不接受新路线 22 | S = S1; 23 | R = R1; 24 | end 25 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/作业代码/TSP模拟退火Matlab代码/NewAnswer.m: -------------------------------------------------------------------------------- 1 | function S2 = NewAnswer(S1) 2 | %% 输入 3 | % S1:当前解 4 | %% 输出 5 | % S2:新解 6 | N = length(S1); 7 | S2 = S1; 8 | a = round(rand(1,2)*(N-1)+1); %产生两个随机位置 用来交换 9 | W = S2(a(1)); 10 | S2(a(1)) = S2(a(2)); 11 | S2(a(2)) = W; %得到一个新路线 -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/作业代码/TSP模拟退火Matlab代码/OutputPath.m: -------------------------------------------------------------------------------- 1 | function p = OutputPath(R) 2 | %% 输出路径函数 3 | % 输入:R 路径 4 | R = [R,R(1)]; 5 | N = length(R); 6 | p = num2str(R(1)); 7 | for i = 2:N 8 | p = [p,'—>',num2str(R(i))]; 9 | end 10 | disp(p) 11 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/作业代码/TSP模拟退火Matlab代码/PathLength.m: -------------------------------------------------------------------------------- 1 | function Length = PathLength(D,Route) 2 | %% 计算各个体的路径长度 3 | % 输入: 4 | % D 两两城市之间的距离 5 | % Route 个体的轨迹 6 | 7 | Length = 0; 8 | n = size(Route,2); 9 | for i = 1:(n - 1) 10 | Length = Length + D(Route(i),Route(i + 1)); 11 | end 12 | Length = Length + D(Route(n),Route(1)); 13 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/作业代码/TSP模拟退火Matlab代码/main.m: -------------------------------------------------------------------------------- 1 | %% I. 清空环境变量 2 | clear all 3 | clc 4 | 5 | %% II. 导入城市位置数据 6 | X = [16.4700 96.1000 7 | 16.4700 94.4400 8 | 20.0900 92.5400 9 | 22.3900 93.3700 10 | 25.2300 97.2400 11 | 22.0000 96.0500 12 | 20.4700 97.0200 13 | 17.2000 96.2900 14 | 16.3000 97.3800 15 | 14.0500 98.1200 16 | 16.5300 97.3800 17 | 21.5200 95.5900 18 | 19.4100 97.1300 19 | 20.0900 92.5500]; 20 | 21 | %% III. 计算距离矩阵 22 | D = Distance(X); %计算距离矩阵 23 | N = size(D,1); %城市的个数 24 | 25 | %% IV. 初始化参数 26 | T0 = 1e10; % 初始温度 27 | Tend = 1e-30; % 终止温度 28 | L = 2; % 各温度下的迭代次数 29 | q = 0.9; %降温速率 30 | syms x; 31 | Time = ceil(double(solve(T0*(0.9)^x == Tend))); % 计算迭代的次数 32 | % Time = 132; 33 | count = 0; %迭代计数 34 | Obj = zeros(Time,1); %目标值矩阵初始化 35 | track = zeros(Time,N); %每代的最优路线矩阵初始化 36 | 37 | %% V. 随机产生一个初始路线 38 | S1 = randperm(N); 39 | DrawPath(S1,X) 40 | disp('初始种群中的一个随机值:') 41 | OutputPath(S1); 42 | Rlength = PathLength(D,S1); 43 | disp(['总距离:',num2str(Rlength)]); 44 | 45 | %% VI. 迭代优化 46 | while T0 > Tend 47 | count = count + 1; %更新迭代次数 48 | temp = zeros(L,N+1); 49 | %% 50 | for k = 1:L 51 | % 1. 产生新解 52 | S2 = NewAnswer(S1); 53 | % 2. Metropolis法则判断是否接受新解 54 | [S1 R] = Metropolis(S1, S2, D, T0); % Metropolis抽样算法 55 | temp(k, :) = [S1 R]; % 记录下一路线及其长度 56 | end 57 | %% 3. 记录每次迭代过程的最优路线 58 | [d0, index] = min(temp(:, end)); % 找出当前温度下最优路线 59 | if count == 1 || d0 <= Obj(count-1) 60 | Obj(count) = d0; % 如果当前温度下最优路程小于上一路程则记录当前路程 61 | else 62 | Obj(count) = Obj(count-1); % 如果当前温度下最优路程大于上一路程则记录上一路程 63 | end 64 | track(count, :) = temp(index, 1:end-1); % 记录当前温度的最优路线 65 | %降温 66 | T0 = q * T0; 67 | end 68 | 69 | %% VII. 优化过程迭代图 70 | figure 71 | plot(1:count,Obj) 72 | xlabel('迭代次数') 73 | ylabel('距离') 74 | title('优化过程') 75 | 76 | %% VIII. 绘制最优路径图 77 | DrawPath(track(end,:),X) 78 | 79 | %% IX. 输出最优解的路线和总距离 80 | disp('最优解:') 81 | S = track(end,:); 82 | p = OutputPath(S); 83 | disp(['总距离:',num2str(PathLength(D,S))]); 84 | -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/实验结果图/sol-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/实验结果图/sol-1.png -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/实验结果图/sol-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/实验结果图/sol-2.png -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/实验结果图/sol-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/实验结果图/sol-3.png -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/实验结果图/sol-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/实验结果图/sol-4.png -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/实验结果图/sol-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/实验结果图/sol-5.png -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/实验结果图/sol-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/实验结果图/sol-6.png -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/实验结果图/最优解路线图.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/实验结果图/最优解路线图.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/实验结果图/模拟退火算法优化过程图.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/实验结果图/模拟退火算法优化过程图.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/实验结果图/随机路线图.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/UCAS-Algorithm-design-Homework-考试后作业/实验结果图/随机路线图.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/拉斯维加斯算法结合分枝限界算法解决电路板布线问题.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/拉斯维加斯算法结合分枝限界算法解决电路板布线问题.doc -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/拉斯维加斯算法结合分枝限界算法解决电路板布线问题.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/拉斯维加斯算法结合分枝限界算法解决电路板布线问题.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/计算机算法设计与分析-Chap1&2作业-周胤昌.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/计算机算法设计与分析-Chap1&2作业-周胤昌.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/计算机算法设计与分析-Chap3作业-周胤昌.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/计算机算法设计与分析-Chap3作业-周胤昌.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/计算机算法设计与分析-Chap4作业-周胤昌.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/计算机算法设计与分析-Chap4作业-周胤昌.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/计算机算法设计与分析-Chap5作业-周胤昌.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/计算机算法设计与分析-Chap5作业-周胤昌.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/计算机算法设计与分析-Chap6&7作业-周胤昌.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/计算机算法设计与分析-Chap6&7作业-周胤昌.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/计算机算法设计与分析-Chap8作业-周胤昌.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/计算机算法设计与分析-Chap8作业-周胤昌.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/计算机算法设计与分析-Chap9&10&11作业-周胤昌.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/计算机算法设计与分析-Chap9&10&11作业-周胤昌.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/计算机算法设计与分析-周胤昌作业-正式提交版.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/计算机算法设计与分析-周胤昌作业-正式提交版.pdf -------------------------------------------------------------------------------- /作业LaTeX解答-正式提交版/计算机算法设计与分析-考试后作业-周胤昌.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业LaTeX解答-正式提交版/计算机算法设计与分析-考试后作业-周胤昌.pdf -------------------------------------------------------------------------------- /作业题目+老师解答/第1,2章练习.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业题目+老师解答/第1,2章练习.pdf -------------------------------------------------------------------------------- /作业题目+老师解答/第1,2章练习参考答案.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业题目+老师解答/第1,2章练习参考答案.pdf -------------------------------------------------------------------------------- /作业题目+老师解答/第3章练习.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业题目+老师解答/第3章练习.pdf -------------------------------------------------------------------------------- /作业题目+老师解答/第3章练习参考答案.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业题目+老师解答/第3章练习参考答案.pdf -------------------------------------------------------------------------------- /作业题目+老师解答/第4章贪心算法练习.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业题目+老师解答/第4章贪心算法练习.pdf -------------------------------------------------------------------------------- /作业题目+老师解答/第4章贪心算法练习参考答案.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业题目+老师解答/第4章贪心算法练习参考答案.pdf -------------------------------------------------------------------------------- /作业题目+老师解答/第5章动态规划练习.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业题目+老师解答/第5章动态规划练习.pdf -------------------------------------------------------------------------------- /作业题目+老师解答/第5章动态规划练习参考答案.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业题目+老师解答/第5章动态规划练习参考答案.pdf -------------------------------------------------------------------------------- /作业题目+老师解答/第6,7章练习.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业题目+老师解答/第6,7章练习.pdf -------------------------------------------------------------------------------- /作业题目+老师解答/第6,7章练习参考答案.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业题目+老师解答/第6,7章练习参考答案.pdf -------------------------------------------------------------------------------- /作业题目+老师解答/第8章练习参考答案.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业题目+老师解答/第8章练习参考答案.pdf -------------------------------------------------------------------------------- /作业题目+老师解答/第8章问题复杂度与NP完全性练习.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业题目+老师解答/第8章问题复杂度与NP完全性练习.pdf -------------------------------------------------------------------------------- /作业题目+老师解答/第9 10 11章练习参考答案.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业题目+老师解答/第9 10 11章练习参考答案.pdf -------------------------------------------------------------------------------- /作业题目+老师解答/第9-10-11章练习.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/作业题目+老师解答/第9-10-11章练习.pdf -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/DC-2022.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/DC-2022.pdf -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/DP-2022.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/DP-2022.pdf -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/Greedy-2022.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/Greedy-2022.pdf -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/homework.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | \providecommand\hyper@newdestlabel[2]{} 3 | \providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} 4 | \HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined 5 | \global\let\oldcontentsline\contentsline 6 | \gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} 7 | \global\let\oldnewlabel\newlabel 8 | \gdef\newlabel#1#2{\newlabelxx{#1}#2} 9 | \gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} 10 | \AtEndDocument{\ifx\hyper@anchor\@undefined 11 | \let\contentsline\oldcontentsline 12 | \let\newlabel\oldnewlabel 13 | \fi} 14 | \fi} 15 | \global\let\hyper@last\relax 16 | \gdef\HyperFirstAtBeginDocument#1{#1} 17 | \providecommand*\HyPL@Entry[1]{} 18 | \HyPL@Entry{0<>} 19 | \@writefile{toc}{\contentsline {section}{Problem 1}{2}{section*.1}\protected@file@percent } 20 | \@writefile{loa}{\contentsline {algorithm}{\numberline {1}{\ignorespaces 算法$\textbf {FindMedian}(A, B)$\relax }}{2}{algorithm.1}\protected@file@percent } 21 | \providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}} 22 | \newlabel{alg:FindMedian}{{1}{2}{算法$\textbf {FindMedian}(A, B)$\relax }{algorithm.1}{}} 23 | \@writefile{toc}{\contentsline {section}{Problem 2}{3}{section*.2}\protected@file@percent } 24 | \@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces 翻转二叉树\relax }}{3}{figure.caption.3}\protected@file@percent } 25 | \newlabel{fig:翻转二叉树}{{1}{3}{翻转二叉树\relax }{figure.caption.3}{}} 26 | \@writefile{toc}{\contentsline {section}{Problem 3}{4}{section*.4}\protected@file@percent } 27 | \@writefile{loa}{\contentsline {algorithm}{\numberline {2}{\ignorespaces 算法$\textbf {QuickMul}(x, N)$\relax }}{4}{algorithm.2}\protected@file@percent } 28 | \newlabel{alg:QuickMul}{{2}{4}{算法$\textbf {QuickMul}(x, N)$\relax }{algorithm.2}{}} 29 | \@writefile{toc}{\contentsline {section}{Problem 4}{5}{section*.5}\protected@file@percent } 30 | \@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces 路径的看法示意图\relax }}{5}{figure.caption.6}\protected@file@percent } 31 | \newlabel{fig:路径的看法示意图}{{2}{5}{路径的看法示意图\relax }{figure.caption.6}{}} 32 | \@writefile{loa}{\contentsline {algorithm}{\numberline {3}{\ignorespaces 算法$\textbf {dfs}(\text {TreeNode}\,\,\text {node})$\relax }}{5}{algorithm.3}\protected@file@percent } 33 | \newlabel{alg:dfs}{{3}{5}{算法$\textbf {dfs}(\text {TreeNode}\,\,\text {node})$\relax }{algorithm.3}{}} 34 | \@writefile{toc}{\contentsline {section}{Problem 5}{6}{section*.7}\protected@file@percent } 35 | \@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces 三路快排分区示意图\relax }}{6}{figure.caption.8}\protected@file@percent } 36 | \newlabel{fig:三路快排分区示意图}{{3}{6}{三路快排分区示意图\relax }{figure.caption.8}{}} 37 | \@writefile{loa}{\contentsline {algorithm}{\numberline {4}{\ignorespaces 三路快速排序\textbf {QuickSort3}算法\relax }}{6}{algorithm.4}\protected@file@percent } 38 | \newlabel{alg:三路快速排序}{{4}{6}{三路快速排序\textbf {QuickSort3}算法\relax }{algorithm.4}{}} 39 | \@writefile{loa}{\contentsline {algorithm}{\numberline {5}{\ignorespaces 三色国旗问题的\textbf {ThreeColor}算法\relax }}{7}{algorithm.5}\protected@file@percent } 40 | \newlabel{alg:三色国旗算法}{{5}{7}{三色国旗问题的\textbf {ThreeColor}算法\relax }{algorithm.5}{}} 41 | \bibstyle{unsrt} 42 | \bibdata{refs} 43 | \@writefile{toc}{\contentsline {section}{Problem 6}{8}{section*.9}\protected@file@percent } 44 | \@writefile{loa}{\contentsline {algorithm}{\numberline {6}{\ignorespaces 切绳子\textbf {CutRope}算法\relax }}{8}{algorithm.6}\protected@file@percent } 45 | \newlabel{alg:切绳子}{{6}{8}{切绳子\textbf {CutRope}算法\relax }{algorithm.6}{}} 46 | \newlabel{fig:ucas-logo}{{\caption@xref {fig:ucas-logo}{ on input line 364}}{8}{Problem \arabic {homeworkProblemCounter}}{figure.caption.10}{}} 47 | \gdef \@abspage@last{8} 48 | -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/homework.listing: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace std; 5 | void QuickSort3(vector& nums, int left, int right) { 6 | if(left >= right) { 7 | return; 8 | } 9 | int rand_index = left + rand()%(right - left + 1); 10 | swap(nums[left], nums[rand_index]); 11 | int pivot = nums[left]; 12 | int lt = left - 1, i = left, gt = right + 1; 13 | while(i < gt) { 14 | if(nums[i] == pivot) { 15 | i++; 16 | } 17 | else if(nums[i] > pivot) { 18 | swap(nums[i], nums[gt - 1]); 19 | gt--; 20 | } 21 | else if(nums[i] < pivot) { 22 | swap(nums[lt + 1], nums[i]); 23 | lt++, i++; 24 | } 25 | } 26 | QuickSort3(nums, left, lt); 27 | QuickSort3(nums, gt, right); 28 | } 29 | -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/homework.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [1][-]{section*.1}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001}{}% 1 2 | \BOOKMARK [1][-]{section*.2}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0002}{}% 2 3 | \BOOKMARK [1][-]{section*.4}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0003}{}% 3 4 | \BOOKMARK [1][-]{section*.5}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0004}{}% 4 5 | \BOOKMARK [1][-]{section*.7}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0005}{}% 5 6 | \BOOKMARK [1][-]{section*.9}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0006}{}% 6 7 | -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/homework.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/homework.pdf -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/homework.synctex.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/homework.synctex.gz -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/images/title/Cyber.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/images/title/Cyber.jpg -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/images/title/ucas-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/images/title/ucas-logo.png -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/images/title/ucas_logo 1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/images/title/ucas_logo 1.pdf -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/images/title/三路快速排序.agx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/images/title/三路快速排序.agx -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/images/title/三路快速排序.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/images/title/三路快速排序.pdf -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/images/title/二叉树直径.agx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/images/title/二叉树直径.agx -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/images/title/二叉树直径.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/images/title/二叉树直径.pdf -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/images/title/翻转二叉树.agx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/images/title/翻转二叉树.agx -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/images/title/翻转二叉树.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/images/title/翻转二叉树.pdf -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/计算机算法设计与分析-Chap2作业-周胤昌.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap2/计算机算法设计与分析-Chap2作业-周胤昌.pdf -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap3/homework.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | \providecommand\hyper@newdestlabel[2]{} 3 | \providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} 4 | \HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined 5 | \global\let\oldcontentsline\contentsline 6 | \gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} 7 | \global\let\oldnewlabel\newlabel 8 | \gdef\newlabel#1#2{\newlabelxx{#1}#2} 9 | \gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} 10 | \AtEndDocument{\ifx\hyper@anchor\@undefined 11 | \let\contentsline\oldcontentsline 12 | \let\newlabel\oldnewlabel 13 | \fi} 14 | \fi} 15 | \global\let\hyper@last\relax 16 | \gdef\HyperFirstAtBeginDocument#1{#1} 17 | \providecommand*\HyPL@Entry[1]{} 18 | \HyPL@Entry{0<>} 19 | \@writefile{toc}{\contentsline {section}{Problem 1}{2}{section*.1}\protected@file@percent } 20 | \@writefile{toc}{\contentsline {section}{Problem 2}{4}{section*.2}\protected@file@percent } 21 | \@writefile{toc}{\contentsline {section}{Problem 3}{6}{section*.3}\protected@file@percent } 22 | \@writefile{toc}{\contentsline {section}{Problem 4}{9}{section*.4}\protected@file@percent } 23 | \@writefile{toc}{\contentsline {section}{Problem 5}{10}{section*.5}\protected@file@percent } 24 | \@writefile{toc}{\contentsline {section}{Problem 6}{12}{section*.6}\protected@file@percent } 25 | \@writefile{toc}{\contentsline {section}{Problem 7}{14}{section*.7}\protected@file@percent } 26 | \@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces $n=3$且结构唯一的二叉搜索树示例\relax }}{14}{figure.caption.8}\protected@file@percent } 27 | \providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}} 28 | \newlabel{fig:二叉搜索树示例}{{1}{14}{$n=3$且结构唯一的二叉搜索树示例\relax }{figure.caption.8}{}} 29 | \@writefile{toc}{\contentsline {section}{Problem 8}{15}{section*.9}\protected@file@percent } 30 | \bibstyle{unsrt} 31 | \bibdata{refs} 32 | \gdef \@abspage@last{18} 33 | -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap3/homework.listing: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | string longestPalindrome(string s) { 4 | int n = s.size(), L = 1, index = 0; 5 | string res; 6 | if(n < 2) res = s; 7 | vector> dp(n, vector(n, 0)); 8 | dp[0][0] = 1; 9 | for(int j = 0; j < n; j++) { //注意循环变量i,j的顺序不能反, 10 | for(int i = 0; i <= j; i++) { //因为求解方向是从左往右的! 11 | if(s[i] != s[j]) { 12 | dp[i][j] = 0; 13 | } 14 | else { 15 | if(j - i < 2) { 16 | dp[i][j] = 1; 17 | if(L < j - i + 1) { 18 | L = j - i + 1; 19 | index = i; 20 | } 21 | } 22 | else { 23 | dp[i][j] = dp[i + 1][j - 1]; 24 | if(dp[i][j] == 1) { 25 | if(L < j - i + 1) { 26 | L = j - i + 1; 27 | index = i; 28 | } 29 | } 30 | } 31 | } 32 | } 33 | } 34 | return s.substr(index, L); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap3/homework.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [1][-]{section*.1}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001}{}% 1 2 | \BOOKMARK [1][-]{section*.2}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0002}{}% 2 3 | \BOOKMARK [1][-]{section*.3}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0003}{}% 3 4 | \BOOKMARK [1][-]{section*.4}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0004}{}% 4 5 | \BOOKMARK [1][-]{section*.5}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0005}{}% 5 6 | \BOOKMARK [1][-]{section*.6}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0006}{}% 6 7 | \BOOKMARK [1][-]{section*.7}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0007}{}% 7 8 | \BOOKMARK [1][-]{section*.9}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0008}{}% 8 9 | -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap3/homework.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap3/homework.pdf -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap3/homework.synctex.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap3/homework.synctex.gz -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap3/images/title/Cyber.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap3/images/title/Cyber.jpg -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap3/images/title/ucas-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap3/images/title/ucas-logo.png -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap3/images/title/ucas_logo 1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap3/images/title/ucas_logo 1.pdf -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap3/images/title/二叉搜索树示例.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap3/images/title/二叉搜索树示例.pdf -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap3/计算机算法设计与分析-Chap3作业-周胤昌.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap3/计算机算法设计与分析-Chap3作业-周胤昌.pdf -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap4/homework.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | \providecommand\hyper@newdestlabel[2]{} 3 | \providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} 4 | \HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined 5 | \global\let\oldcontentsline\contentsline 6 | \gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} 7 | \global\let\oldnewlabel\newlabel 8 | \gdef\newlabel#1#2{\newlabelxx{#1}#2} 9 | \gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} 10 | \AtEndDocument{\ifx\hyper@anchor\@undefined 11 | \let\contentsline\oldcontentsline 12 | \let\newlabel\oldnewlabel 13 | \fi} 14 | \fi} 15 | \global\let\hyper@last\relax 16 | \gdef\HyperFirstAtBeginDocument#1{#1} 17 | \providecommand*\HyPL@Entry[1]{} 18 | \HyPL@Entry{0<>} 19 | \@writefile{toc}{\contentsline {section}{Problem 1}{2}{section*.1}\protected@file@percent } 20 | \@writefile{toc}{\contentsline {section}{Problem 2}{4}{section*.2}\protected@file@percent } 21 | \@writefile{toc}{\contentsline {section}{Problem 3}{5}{section*.3}\protected@file@percent } 22 | \@writefile{toc}{\contentsline {section}{Problem 4}{6}{section*.4}\protected@file@percent } 23 | \@writefile{toc}{\contentsline {section}{Problem 5}{7}{section*.5}\protected@file@percent } 24 | \@writefile{toc}{\contentsline {section}{Problem 6}{8}{section*.6}\protected@file@percent } 25 | \bibstyle{unsrt} 26 | \bibdata{refs} 27 | \@writefile{toc}{\contentsline {section}{Problem 7}{9}{section*.7}\protected@file@percent } 28 | \gdef \@abspage@last{9} 29 | -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap4/homework.listing: -------------------------------------------------------------------------------- 1 | 开始运行... 2 | 第1个测试样例的结果为0 3 | 第2个测试样例的结果为0 4 | 第3个测试样例的结果为6 5 | 第4个测试样例的结果为15 6 | 第5个测试样例的结果为22 7 | 第6个测试样例的结果为49 8 | 运行结束. 9 | -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap4/homework.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [1][-]{section*.1}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0001}{}% 1 2 | \BOOKMARK [1][-]{section*.2}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0002}{}% 2 3 | \BOOKMARK [1][-]{section*.3}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0003}{}% 3 4 | \BOOKMARK [1][-]{section*.4}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0004}{}% 4 5 | \BOOKMARK [1][-]{section*.5}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0005}{}% 5 6 | \BOOKMARK [1][-]{section*.6}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0006}{}% 6 7 | \BOOKMARK [1][-]{section*.7}{\376\377\000P\000r\000o\000b\000l\000e\000m\000\040\0007}{}% 7 8 | -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap4/homework.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap4/homework.pdf -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap4/homework.synctex.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap4/homework.synctex.gz -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap4/计算机算法设计与分析-Chap4作业-周胤昌.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/UCAS-Algorithm-design-Homework-Chap4/计算机算法设计与分析-Chap4作业-周胤昌.pdf -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/1-OJ-C++代码/A-1.py: -------------------------------------------------------------------------------- 1 | a=input().split() 2 | 3 | a=list(a) 4 | 5 | lena=len(a) 6 | 7 | i=0 8 | 9 | max=0 10 | 11 | min=99999 12 | 13 | while inum: 22 | min=num 23 | flagmin=i 24 | 25 | i+=1 26 | 27 | print(a[flagmax]) 28 | 29 | print(a[flagmin]) -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/1-OJ-C++代码/B-2.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/1-OJ-C++代码/B-2.c -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/1-OJ-C++代码/B-2.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/1-OJ-C++代码/B-2.cpp -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/1-OJ-C++代码/C-3.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/1-OJ-C++代码/C-3.cpp -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/1-OJ-C++代码/D-4.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/1-OJ-C++代码/D-4.cpp -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/1-OJ-C++代码/E-5.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/1-OJ-C++代码/E-5.cpp -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/2-OJ-C++代码/A-1.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/2-OJ-C++代码/A-1.cpp -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/2-OJ-C++代码/B-2.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/2-OJ-C++代码/B-2.cpp -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/2-OJ-C++代码/C-3.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/2-OJ-C++代码/C-3.cpp -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/2-OJ-C++代码/D-4.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/2-OJ-C++代码/D-4.cpp -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/2-OJ-C++代码/E-5.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/2-OJ-C++代码/E-5.cpp -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/3-OJ-C++代码/A.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/3-OJ-C++代码/A.cpp -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/3-OJ-C++代码/B.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/3-OJ-C++代码/B.cpp -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/3-OJ-C++代码/C.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/3-OJ-C++代码/C.cpp -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/3-OJ-C++代码/D.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/3-OJ-C++代码/D.cpp -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/3-OJ-C++代码/E.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/卜算OJ作业代码/3-OJ-C++代码/E.cpp -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/算法讲义_卜东波.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/算法讲义_卜东波.pdf -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/计算机算法设计与分析(卜算)-Chap2作业-周胤昌.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/计算机算法设计与分析(卜算)-Chap2作业-周胤昌.pdf -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/计算机算法设计与分析(卜算)-Chap3作业-周胤昌.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/计算机算法设计与分析(卜算)-Chap3作业-周胤昌.pdf -------------------------------------------------------------------------------- /算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/计算机算法设计与分析(卜算)-Chap4作业-周胤昌.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-卜东波作业+OJ+讲义(强烈推荐旁听)/计算机算法设计与分析(卜算)-Chap4作业-周胤昌.pdf -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/2018-2019计算机算法设计与分析_国科大_陈玉福.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/2018-2019计算机算法设计与分析_国科大_陈玉福.pdf -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/2018-2019试题部分答案——陈玉福.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/2018-2019试题部分答案——陈玉福.pdf -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/2018-2019马.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/2018-2019马.pdf -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/2018-2019马答案第一题.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/2018-2019马答案第一题.docx -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/2019-12-24计算机算法设计与分析陈玉福老师——回忆版.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/2019-12-24计算机算法设计与分析陈玉福老师——回忆版.pdf -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/README.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/中科院_算法试题_陈玉福.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/中科院_算法试题_陈玉福.docx -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/中科院计算机算法设计与分析各章作业+历年习题.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/中科院计算机算法设计与分析各章作业+历年习题.pdf -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/中科院陈玉福计算机算法设计与分析期末简答题答案.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/中科院陈玉福计算机算法设计与分析期末简答题答案.pdf -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/算法设计与分析历年真题归纳总结.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/算法设计与分析历年真题归纳总结.pdf -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/算法设计与分析期末部分考题答案.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/算法设计与分析期末部分考题答案.pdf -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/算法设计与分析试题2005A.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/算法设计与分析试题2005A.doc -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/算法设计与分析试题2006A.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/算法设计与分析试题2006A.doc -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/算法设计与分析试题2007A.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/算法设计与分析试题2007A.doc -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/算法设计与分析试题2008A.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/算法设计与分析试题2008A.doc -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/算法设计与分析试题2009A.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/算法设计与分析试题2009A.doc -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/算法设计与分析试题2010A.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/算法设计与分析试题2010A.doc -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/算法设计与分析试题2011秋.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/算法设计与分析试题2011秋.doc -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/算法设计与分析试题2011补考.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/算法设计与分析试题2011补考.doc -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/算法试题.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/算法试题.pdf -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/考试范围.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/往年试卷/考试范围.pdf -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/第一章作业/README.txt: -------------------------------------------------------------------------------- 1 | 包含教材第一章练习题1~8 2 | -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/第一章作业/第三周作业.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/第一章作业/第三周作业.pdf -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/第七章作业/7_2.py: -------------------------------------------------------------------------------- 1 | #7.2 0/1背包的分支定界 2 | import numpy as np 3 | import math 4 | import copy 5 | import random 6 | class Node: 7 | def __init__(self,Parent=None,Level=None,Tag=None,CC=None,CV=None,CUB=None): 8 | self.Parent=Parent#指向父节点的指针 9 | self.Level=Level#节点在解空间中的深度 10 | self.Tag=Tag#该节点深度对应的物品那还是不拿1/0 11 | self.CC=CC#该节点下背包的剩余空间 12 | self.CV=CV#该节点下物品的价值 13 | self.CUB=CUB#该节点下可能达到的物品价值上界Puv,该上界≥真实上界 14 | def LUBound(P,W,cap,cv,N,k): 15 | global Pvl,Pvu 16 | Pvl=cv#初始化下界为当前价值 17 | rw=cap#剩余容量 18 | for i in range(k-1,N): 19 | if rw=W[j]: 23 | rw-=W[j] 24 | Pvl+=P[j]#贪心 25 | return 26 | rw-=W[i] 27 | Pvl+=P[i] 28 | Pvu=Pvl 29 | def NewNode(parent,level,tag,cap,cv,ub): 30 | global EL 31 | a=Node(parent,level,tag,cap,cv,ub) 32 | EL.append(a) 33 | def Finsh(CV,ANS,N,P,W,M): 34 | print("价值数组为:",P) 35 | print("质量数组为:",W) 36 | print("背包容量为:",M) 37 | print("背包内剩余空间为",ANS.CC) 38 | print("背包内总价值为",ANS.CV) 39 | solve=[] 40 | for j in range(N-1,-1,-1): 41 | if ANS.Tag==1: 42 | solve.append(j+1) 43 | ANS=ANS.Parent 44 | print("应该拿的物品为:",solve) 45 | 46 | def Largest():#在活结点表中取一个具有最大Pvu值的节点作为当前扩展结点 47 | global EL 48 | temp=-1 49 | idx=-1 50 | for i in range(0,len(EL)): 51 | if EL[i].CUB>temp: 52 | idx=i 53 | temp=EL[i].CUB 54 | a=EL[idx] 55 | del EL[idx] 56 | return a 57 | def dataPre(P,W): 58 | #按照p/w从大到小顺序排列 59 | P1=np.zeros([P.shape[0]]) 60 | W1=np.zeros([W.shape[0]]) 61 | middle=P/W 62 | idx=middle.argsort() 63 | for i in range(0,P.shape[0]): 64 | P1[i]=P[idx[-i-1]] 65 | W1[i]=W[idx[-i-1]] 66 | return P1,W1 67 | def maxValue(P,W,M): 68 | # global P,W,EL,M 69 | #价值,重量,活节点表,背包容量 70 | global Pvl,Pvu,prev,EL,ANS 71 | #下界,上界 72 | N=P.shape[0] 73 | LUBound(P,W,M,0,N,1) 74 | # E1=Node(None,-1,None,M,0,Pvu)#生成根节点 75 | E=Node(None,-1,None,M,0,Pvu)#生成根节点 76 | EL.append(E)#将根节点加入活结点表 77 | prev=Pvl 78 | # E.CUB=Pvu 79 | while True: 80 | i=E.Level+1 81 | cap=E.CC 82 | cv=E.CV 83 | if i==N: 84 | if cv>=prev: 85 | prev=cv 86 | ANS=E 87 | #开始定界 88 | else:#E是内部节点,接下来判断哪个儿子可行 89 | if cap>=W[i]:#可拿,左儿子活 90 | NewNode(E,i,1,cap-W[i],cv+P[i],E.CUB) 91 | # prev=max(prev,Pvl-epsilon) 92 | LUBound(P,W,cap,cv,N,i+1) 93 | #这里更新了Pvl和Pvu为不拿第i个物品的上下界 94 | if Pvu>prev: 95 | #不拿,只要可能的上界>已知最好结果也可活 96 | NewNode(E,i,0,cap,cv,Pvu) 97 | prev=max(prev,Pvl-epsilon) 98 | if len(EL)==0: 99 | break 100 | E=Largest() 101 | if E.CUB EL[i].Time: 30 | temp=EL[i].Time 31 | idx=i 32 | a=EL[idx] 33 | del EL[idx] 34 | return a 35 | def minTime(): 36 | global t,K,bestT,EL,N,soluSet 37 | E=Node(None,-1,[-1 for i in range(0,N)],0) 38 | EL.append(E) 39 | count=0 40 | while True: 41 | count+=1 42 | L=E.Level+1 43 | if L==N: 44 | if bestT>E.Time: 45 | bestT=E.Time#到了叶节点才更新 46 | soluSet.append(copy.deepcopy(E)) 47 | else:#E为中间节点 48 | if E.Time <= bestT:#如果该节点可活 49 | for i in range(0,K): 50 | getNewnode(E,i) 51 | if len(EL)==0: 52 | break 53 | E=Shortest() 54 | for i in range(0,len(soluSet)): 55 | print('共有',K,'台机器') 56 | print('任务时间数组为',t) 57 | print('最优解为:',np.reshape(soluSet[i].Solve,[1,N])+1) 58 | print('最短时间为:',soluSet[i].Time) 59 | EL=[]#活节点表 60 | soluSet=[]#最优解集 61 | t=[5,12,6,4,9,6,3,15]#任务时间数组 62 | K=4#机器数 63 | N=len(t) 64 | bestT=1e5#下界 65 | minTime() 66 | -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/第七章作业/README.txt: -------------------------------------------------------------------------------- 1 | 本目录包含第七章练习题1、2、3 2 | -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/第七章作业/张子钰_第七次作业.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/第七章作业/张子钰_第七次作业.pdf -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/第三章作业/README.txt: -------------------------------------------------------------------------------- 1 | 本目录包含第三章练习题1~4 2 | -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/第三章作业/mergeSort.py: -------------------------------------------------------------------------------- 1 | #归并排序 2 | import numpy as np 3 | import math 4 | import time 5 | def mergeSort(arr): 6 | L=len(arr) 7 | if(L<2):#若 8 | return arr 9 | gap = math.floor(L/2) 10 | left = arr[0:gap] 11 | right = arr[gap:L]#分治 12 | return merge(mergeSort(left),mergeSort(right)) 13 | def merge(left,right): 14 | result=[] 15 | while(len(left)>0 and len(right)>0): 16 | if left[0]<=right[0]: 17 | result.append(left[0]) 18 | del left[0] 19 | else: 20 | result.append(right[0]) 21 | del right[0] 22 | while(len(left)):#剩下的已经保证是顺序了,依次插入 23 | result.append(left[0]) 24 | del left[0] 25 | while(len(right)): 26 | result.append(right[0]) 27 | del right[0] 28 | return result 29 | # a=[1,3,5,7,2,4,6,8,3,4,5,61,123,4,2,72,4,9,223,4] 30 | n=200000 31 | a=np.random.rand(n).tolist() 32 | tic=time.time() 33 | b=mergeSort(a) 34 | toc=time.time() 35 | d=toc-tic 36 | print(b) 37 | print('数组长度为:',n,'。耗费时间为:',d,'s') -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/第三章作业/quickSort.py: -------------------------------------------------------------------------------- 1 | #快速排序 2 | import numpy as np 3 | import time 4 | def QS(arr,left,right): 5 | L=len(arr) 6 | if left0: 11 | b[0,i]=b[0,i-1]+arr[i] 12 | else: 13 | b[0,i]=arr[i] 14 | if b[0,i]>sum: 15 | sum=b[0,i] 16 | return sum 17 | arr=[5,31,-35,100,-5,-2,10,-3,1,-5,6,-6,-10] 18 | sum=MaxSub() 19 | print('给定数组为:{',arr,'}') 20 | print('最大子段和为',sum) -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/第五章作业/A2.py: -------------------------------------------------------------------------------- 1 | # 2 | import numpy as np 3 | import math 4 | def minT(): 5 | Ta=0#公式中的T_a 6 | Tb=0#公式中的T_b 7 | T=0#公式中的T 8 | for i in range(0,len(a)): 9 | if(Ta+a[i]T): 10 | Ta+=a[i] 11 | T=Ta 12 | elif(Tb+b[i]T): 13 | Tb+=b[i] 14 | T=Tb 15 | else: 16 | if(Ta+a[i]N or max(solu)>=N: 11 | return False 12 | for i in range(0,len(solu)): 13 | fee+=cost[i,solu[i]] 14 | return fee 15 | def minFee(): 16 | #solu为当前决策序列 17 | #cost是一个n x n的矩阵,cij表示第i个工作给第j个人完成所需要的费用 18 | global bestFee 19 | global feeSet 20 | global soluSet 21 | global cost 22 | X=[0 for i in range(0,N)] 23 | k=0 24 | X[k]=-1 25 | while k>=0: 26 | X[k]+=1 27 | while X[k]bestFee: 28 | X[k]+=1#转到下一个工人 29 | if X[k]<= N-1: 30 | if k==N-1: 31 | # print(X) 32 | #需要深拷贝 33 | soluSet.append(copy.deepcopy(X)) 34 | bestFee=computeFee(X) 35 | feeSet.append(bestFee) 36 | else: 37 | k+=1#开启下一个任务 38 | X[k]=-1 39 | else: 40 | k-=1 41 | print('价格矩阵为:\n',cost) 42 | idx=feeSet.index(bestFee) 43 | print('最优解为',soluSet[idx]) 44 | print('最优解值为',feeSet[idx]) 45 | #global 46 | #如果递归函数传递可用人编号集,则回溯的时候不好操作,需要用全局标记 47 | cost=np.array([[1,3,3],[3,1,2],[1,3,2]]) 48 | N=cost.shape[0] 49 | bestFee=1e8 50 | soluSet=[]#解集 51 | feeSet=[] 52 | minFee() -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/第六章作业/6_3.py: -------------------------------------------------------------------------------- 1 | 2 | #6.2 3 | # 4 | # cost=[n,n] 5 | import numpy as np 6 | import matplotlib.pyplot as plt 7 | import copy 8 | def computeTime(solu): 9 | Time=[0 for i in range(0,K)] 10 | if len(solu)>N or max(solu)>=K: 11 | return False 12 | for i in range(0,len(solu)): 13 | Time[solu[i]]+=t[i] 14 | return max(Time) 15 | def boundPre():#先用局部贪心求解一个上界 16 | time=[0 for i in range(0,K)] 17 | for i in range(0,N): 18 | time[time.index(min(time))]+=t[i] 19 | return max(time) 20 | def minTime(): 21 | global bestTime 22 | global timeSet 23 | global soluSet 24 | #x[k]表示第k个任务由x[k]个机器完成 25 | X=[0 for i in range(0,N)] 26 | k=0 27 | count=0 28 | X[k]=-1 29 | bPre=boundPre() 30 | while k>=0: 31 | X[k]+=1 32 | while X[k]bestTime: 33 | X[k]+=1#转到下一个机器 34 | if X[k]<= K-1: 35 | if k==N-1: 36 | #需要深拷贝 37 | soluSet.append(copy.deepcopy(X)) 38 | count +=1 39 | # if bestTime>computeTime(X): 40 | # bestTime=computeTime(X) 41 | if bestTime>min([computeTime(X),bPre]): 42 | bestTime=min([computeTime(X),bPre])#只有当找到一个解时,上界才进行更新 43 | timeSet.append(computeTime(X)) 44 | else: 45 | k+=1#开启下一个任务 46 | X[k]=-1 47 | else: 48 | k-=1#回溯 49 | print('费用矩阵为:\n',t) 50 | # print(soluSet) 51 | idx=timeSet.index(bestTime) 52 | print('最优解为',soluSet[idx]) 53 | print('最优解值为',timeSet[idx]) 54 | #global 55 | t=[5,12,7,18,9,6,3,15,9,15,3,2,3,5] 56 | N=len(t) 57 | K=3 58 | bestTime=1e8 59 | soluSet=[]#解集 60 | timeSet=[] 61 | minTime() -------------------------------------------------------------------------------- /算法设计与分析-陈玉福(可作为刘算的补充资料)/UCAS_算法设计-陈玉福-Github资料/第六章作业/6_5.py: -------------------------------------------------------------------------------- 1 | #6.5 2 | # 3 | # 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | import copy 7 | def minWeight(depth): 8 | global N,M,BW,cw,cc,X,minX 9 | if depth==N:#到达叶子节点 10 | if cw>} 19 | \@writefile{toc}{\contentsline {section}{一、多选填空(10分, 每题2分)}{2}{section*.1}\protected@file@percent } 20 | \@writefile{toc}{\contentsline {section}{二、判断正误(10分, 每题2分)}{2}{section*.2}\protected@file@percent } 21 | \@writefile{toc}{\contentsline {section}{三、简答题(25分)}{3}{section*.3}\protected@file@percent } 22 | \@writefile{loa}{\contentsline {algorithm}{\numberline {1}{\ignorespaces 模拟退火算法步骤\relax }}{3}{algorithm.1}\protected@file@percent } 23 | \providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}} 24 | \newlabel{alg:moni}{{1}{3}{模拟退火算法步骤\relax }{algorithm.1}{}} 25 | \@writefile{loa}{\contentsline {algorithm}{\numberline {2}{\ignorespaces 算法$\textbf {FFT}(N,a,w,A)$\relax }}{4}{algorithm.2}\protected@file@percent } 26 | \newlabel{alg:FFT}{{2}{4}{算法$\textbf {FFT}(N,a,w,A)$\relax }{algorithm.2}{}} 27 | \@writefile{toc}{\contentsline {section}{四、算法设计题(55分)}{5}{section*.4}\protected@file@percent } 28 | \@writefile{loa}{\contentsline {algorithm}{\numberline {3}{\ignorespaces \textbf {Test}算法\relax }}{5}{algorithm.3}\protected@file@percent } 29 | \newlabel{alg:Test}{{3}{5}{\textbf {Test}算法\relax }{algorithm.3}{}} 30 | \bibstyle{unsrt} 31 | \bibdata{refs} 32 | \newlabel{fig:ucas-logo}{{\caption@xref {fig:ucas-logo}{ on input line 412}}{7}{四、算法设计题(55分)}{figure.caption.5}{}} 33 | \gdef \@abspage@last{7} 34 | -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2021试卷解答整理/homework.listing: -------------------------------------------------------------------------------- 1 | Node{ 2 | int Path[n]; 3 | int T[k]; 4 | int Time; 5 | int length; 6 | } 7 | Proc BestDispatch(int n, int k, int t[]){ 8 | Node Boot, X, P, result; 9 | int f; 10 | f = n * max(t[]); 11 | Boot.T[n] = {0}; 12 | Boot.Time = 0; 13 | Boot.Path[n] = {0}; 14 | Boot.length=0; 15 | AddHeap(Boot); 16 | while (!Heap.empty()) do { 17 | P = DeleteMinHeap(); 18 | for i = 1 to k do { 19 | X = Newnode(P.Path[], P.T[], P.length + 1); 20 | X.Path[X.length] = i; 21 | X.T[i] = X.T[i] + t[X.length]; 22 | X.Time = max(X.T[]); 23 | if X.length == n then { 24 | if X.Time < f then { 25 | f = X.Time; 26 | result = X; 27 | } 28 | } 29 | else { 30 | if X.Time < f then { 31 | AddHeap(X); 32 | } 33 | } 34 | } 35 | } 36 | } 37 | end {BestDispatch} 38 | -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2021试卷解答整理/homework.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [1][-]{section*.1}{\376\377\116\000\060\001\131\032\220\011\130\153\172\172\000\050\0001\0000\122\006\000,\000\040\153\317\230\230\0002\122\006\000\051}{}% 1 2 | \BOOKMARK [1][-]{section*.2}{\376\377\116\214\060\001\122\044\145\255\153\143\213\357\000\050\0001\0000\122\006\000,\000\040\153\317\230\230\0002\122\006\000\051}{}% 2 3 | \BOOKMARK [1][-]{section*.3}{\376\377\116\011\060\001\173\200\173\124\230\230\000\050\0002\0005\122\006\000\051}{}% 3 4 | \BOOKMARK [1][-]{section*.4}{\376\377\126\333\060\001\173\227\154\325\213\276\213\241\230\230\000\050\0005\0005\122\006\000\051}{}% 4 5 | -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2021试卷解答整理/homework.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2021试卷解答整理/homework.pdf -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2021试卷解答整理/homework.synctex.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2021试卷解答整理/homework.synctex.gz -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2021试卷解答整理/images/title/Cyber.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2021试卷解答整理/images/title/Cyber.jpg -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2021试卷解答整理/images/title/ucas-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2021试卷解答整理/images/title/ucas-logo.png -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2021试卷解答整理/images/title/ucas_logo 1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2021试卷解答整理/images/title/ucas_logo 1.pdf -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2022试卷解答整理.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2022试卷解答整理.pdf -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2022试卷解答整理/UCAS-Algorithm-design-2022试卷解答整理.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2022试卷解答整理/UCAS-Algorithm-design-2022试卷解答整理.pdf -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2022试卷解答整理/homework.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | \providecommand\hyper@newdestlabel[2]{} 3 | \providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} 4 | \HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined 5 | \global\let\oldcontentsline\contentsline 6 | \gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} 7 | \global\let\oldnewlabel\newlabel 8 | \gdef\newlabel#1#2{\newlabelxx{#1}#2} 9 | \gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} 10 | \AtEndDocument{\ifx\hyper@anchor\@undefined 11 | \let\contentsline\oldcontentsline 12 | \let\newlabel\oldnewlabel 13 | \fi} 14 | \fi} 15 | \global\let\hyper@last\relax 16 | \gdef\HyperFirstAtBeginDocument#1{#1} 17 | \providecommand*\HyPL@Entry[1]{} 18 | \HyPL@Entry{0<>} 19 | \@writefile{toc}{\contentsline {section}{一、多选填空(10分, 每题2分)}{2}{section*.1}\protected@file@percent } 20 | \@writefile{toc}{\contentsline {section}{二、判断正误(10分, 每题2分)}{2}{section*.2}\protected@file@percent } 21 | \@writefile{toc}{\contentsline {section}{三、简答题(25分)}{3}{section*.3}\protected@file@percent } 22 | \@writefile{loa}{\contentsline {algorithm}{\numberline {1}{\ignorespaces 遗传算法步骤\relax }}{3}{algorithm.1}\protected@file@percent } 23 | \providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}} 24 | \newlabel{alg:yichuan}{{1}{3}{遗传算法步骤\relax }{algorithm.1}{}} 25 | \@writefile{loa}{\contentsline {algorithm}{\numberline {2}{\ignorespaces 算法$\textbf {ClosePair}(S,d)$\relax }}{4}{algorithm.2}\protected@file@percent } 26 | \newlabel{alg:ClosePair}{{2}{4}{算法$\textbf {ClosePair}(S,d)$\relax }{algorithm.2}{}} 27 | \@writefile{toc}{\contentsline {section}{四、算法设计题(55分)}{4}{section*.4}\protected@file@percent } 28 | \@writefile{loa}{\contentsline {algorithm}{\numberline {3}{\ignorespaces \textbf {Location}算法\relax }}{5}{algorithm.3}\protected@file@percent } 29 | \newlabel{alg:Location}{{3}{5}{\textbf {Location}算法\relax }{algorithm.3}{}} 30 | \bibstyle{unsrt} 31 | \bibdata{refs} 32 | \newlabel{fig:ucas-logo}{{\caption@xref {fig:ucas-logo}{ on input line 392}}{7}{四、算法设计题(55分)}{figure.caption.5}{}} 33 | \gdef \@abspage@last{7} 34 | -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2022试卷解答整理/homework.listing: -------------------------------------------------------------------------------- 1 | Node{ 2 | int Path[n]; 3 | int work[n]; 4 | int T[k]; 5 | int Time; 6 | int length; 7 | } 8 | Proc BestDispatch(int n, int k, int t[]){ 9 | Node Boot, X, P, result; 10 | int f; 11 | f = n * max(t[]); 12 | Boot.T[n] = {0}; 13 | Boot.Time = 0; 14 | Boot.Path[n] = {0}; 15 | Boot.length=0; 16 | AddHeap(Boot); 17 | while (!Heap.empty()) do { 18 | P = DeleteMinHeap(); 19 | for i = 1 to n do { 20 | if(work[i] == 0) { 21 | X = Newnode(P.Path[], P.T[], P.length + 1); 22 | work[i] = 1; 23 | } 24 | X.Path[X.length] = i; 25 | X.T[i] = X.T[i] + t[X.length]; 26 | X.Time = max(X.T[]); 27 | if X.length == n then { 28 | if X.Time < f then { 29 | f = X.Time; 30 | result = X; 31 | } 32 | } 33 | else { 34 | if X.Time < f then { 35 | AddHeap(X); 36 | } 37 | } 38 | } 39 | } 40 | } 41 | end {BestDispatch} 42 | -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2022试卷解答整理/homework.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [1][-]{section*.1}{\376\377\116\000\060\001\131\032\220\011\130\153\172\172\000\050\0001\0000\122\006\000,\000\040\153\317\230\230\0002\122\006\000\051}{}% 1 2 | \BOOKMARK [1][-]{section*.2}{\376\377\116\214\060\001\122\044\145\255\153\143\213\357\000\050\0001\0000\122\006\000,\000\040\153\317\230\230\0002\122\006\000\051}{}% 2 3 | \BOOKMARK [1][-]{section*.3}{\376\377\116\011\060\001\173\200\173\124\230\230\000\050\0002\0005\122\006\000\051}{}% 3 4 | \BOOKMARK [1][-]{section*.4}{\376\377\126\333\060\001\173\227\154\325\213\276\213\241\230\230\000\050\0005\0005\122\006\000\051}{}% 4 5 | -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2022试卷解答整理/homework.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2022试卷解答整理/homework.pdf -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2022试卷解答整理/homework.synctex.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2022试卷解答整理/homework.synctex.gz -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2022试卷解答整理/images/title/Cyber.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2022试卷解答整理/images/title/Cyber.jpg -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2022试卷解答整理/images/title/ucas-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2022试卷解答整理/images/title/ucas-logo.png -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2022试卷解答整理/images/title/ucas_logo 1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/计算机算法设计与分析-期末试卷整理(含往年)/UCAS-Algorithm-design-2022试卷解答整理/images/title/ucas_logo 1.pdf -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/算法设计与分析-2模拟试题2022.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/计算机算法设计与分析-期末试卷整理(含往年)/算法设计与分析-2模拟试题2022.pdf -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/算法设计与分析-2试题2022.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/计算机算法设计与分析-期末试卷整理(含往年)/算法设计与分析-2试题2022.pdf -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/算法设计与分析大纲_083500M01001H_2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/计算机算法设计与分析-期末试卷整理(含往年)/算法设计与分析大纲_083500M01001H_2.pdf -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/考试复习大纲2019.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/计算机算法设计与分析-期末试卷整理(含往年)/考试复习大纲2019.jpg -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/考试复习大纲2020.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/计算机算法设计与分析-期末试卷整理(含往年)/考试复习大纲2020.pdf -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/计算机算法设计与分析考试复习大纲2022.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/计算机算法设计与分析-期末试卷整理(含往年)/计算机算法设计与分析考试复习大纲2022.pdf -------------------------------------------------------------------------------- /计算机算法设计与分析-期末试卷整理(含往年)/计算机算法设计与分析考试通知.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YellowPuppy/UCAS_Algorithm_Design_Course-LYG/6493c1c2f7639599e56977d5e54dae3c7b1f01b1/计算机算法设计与分析-期末试卷整理(含往年)/计算机算法设计与分析考试通知.pdf --------------------------------------------------------------------------------