为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

5.《算法设计与分析》试题库

2017-09-17 50页 doc 254KB 92阅读

用户头像

is_079973

暂无简介

举报
5.《算法设计与分析》试题库5.《算法设计与分析》试题库 《算法分析与设计》试题库(一) 一、 选择题 1.应用Johnson法则的流水作业调度采用的算法是(D) A. 贪心算法 B. 分支限界法 C.分治法 D. 动态规划算法 2.Hanoi塔问题如下图所示。现要求将塔座A上的的所有圆盘移到塔座B上,并 仍按同样顺序叠置。移动圆盘时遵守Hanoi塔问题的移动规则。由此设计出解 Hanoi塔问题的递归算法正确的为:(B) A. void hanoi(int n, int A, int C, int B) { if (n > 0) Han...
5.《算法设计与分析》试题库
5.《算法与分析》试库 《算法分析与设计》试题库(一) 一、 选择题 1.应用Johnson法则的流水作业调度采用的算法是(D) A. 贪心算法 B. 分支限界法 C.分治法 D. 动态规划算法 2.Hanoi塔问题如下图所示。现要求将塔座A上的的所有圆盘移到塔座B上,并 仍按同样顺序叠置。移动圆盘时遵守Hanoi塔问题的移动规则。由此设计出解 Hanoi塔问题的递归算法正确的为:(B) A. void hanoi(int n, int A, int C, int B) { if (n > 0) Hanoi塔 { hanoi(n-1,A,C, B); move(n,a,b); hanoi(n-1, C, B, A); } } B. void hanoi(int n, int A, int B, int C) { if (n > 0) { hanoi(n-1, A, C, B); move(n,a,b); hanoi(n-1, C, B, A); } } C. void hanoi(int n, int C, int B, int A) { if (n > 0) { hanoi(n-1, A, C, B); move(n,a,b); hanoi(n-1, C, B, A); } } used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional D. void hanoi(int n, int C, int A, int B) { if (n > 0) { hanoi(n-1, A, C, B); move(n,a,b); hanoi(n-1, C, B, A); } } 3. 动态规划算法的基本要素为(C) A. 最优子结构性质与贪心选择性质 B(重叠子问题性质与贪心选择性质 C(最优子结构性质与重叠子问题性质 D. 预排序与递归调用 ,,4. 算法分析中,记号O表示(B), 记号表示(A), 记号表示(D)。 A.渐进下界 B.渐进上界 C.非紧上界 D.紧渐进界 E.非紧下界 5. 以下关于渐进记号的性质是正确的有:(A) A. f(n)(g(n)),g(n)(h(n))f(n)(h(n)),,,,,,, B. f(n)O(g(n)),g(n)O(h(n))h(n)O(f(n)),,,, C. O(f(n))+O(g(n)) = O(min{f(n),g(n)}) D. f(n)O(g(n))g(n)O(f(n)),,, 6. 能采用贪心算法求最优解的问题,一般具有的重要性质为:(A) A. 最优子结构性质与贪心选择性质 B(重叠子问题性质与贪心选择性质 C(最优子结构性质与重叠子问题性质 D. 预排序与递归调用 used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional 7. 回溯法在问题的解空间树中,按(D)策略,从根结点出发搜索解空间树。 A.广度优先 B. 活结点优先 C.扩展结点优先 D. 深度优先 8. 分支限界法在问题的解空间树中,按(A)策略,从根结点出发搜索解空间树。 A( 广度优先 B. 活结点优先 C.扩展结点优先 D. 深度优先 9. 程序块(A)是回溯法中遍历排列树的算法框架程序。 A. void backtrack (int t) { if (t>n) output(x); else for (int i=t;i<=n;i++) { swap(x[t], x[i]); if (legal(t)) backtrack(t+1); swap(x[t], x[i]); } } B. void backtrack (int t) { if (t>n) output(x); else for (int i=0;i<=1;i++) { x[t]=i; if (legal(t)) backtrack(t+1); } } void backtrack (int t) C. { if (t>n) output(x); else for (int i=0;i<=1;i++) { x[t]=i; if (legal(t)) backtrack(t-1); } } D. void backtrack (int t) { if (t>n) output(x); else for (int i=t;i<=n;i++) { swap(x[t], x[i]); used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional if (legal(t)) backtrack(t+1); } } 10. 回溯法的效率不依赖于以下哪一个因素,(C ) A. 产生x[k]的时间; B. 满足显约束的x[k]值的个数; C. 问题的解空间的形式; D. 计算上界函数bound的时间; 11. 常见的两种分支限界法为(D) A. 广度优先分支限界法与深度优先分支限界法; B. 队列式(FIFO)分支限界法与堆栈式分支限界法; C. 排列树法与子集树法; D. 队列式(FIFO)分支限界法与优先队列式分支限界法; 12. k带图灵机的空间复杂性S(n)是指(B) A. k带图灵机处理所有长度为n的输入时,在某条带上所使用过的最大方格数。 B. k带图灵机处理所有长度为n的输入时,在k条带上所使用过的方格数的总 和k带图灵机处理所有长度为n的输入时,在k条带上所使用过的平均方格 数。 D. k带图灵机处理所有长度为n的输入时,在某条带上所使用过的最小方格数。 13. NP类语言在图灵机下的定义为(D) A. NP={L|L是一个能在非多项式时间内被一台NDTM所接受的语言}; B. NP={L|L是一个能在多项式时间内被一台NDTM所接受的语言}; C. NP={L|L是一个能在多项式时间内被一台DTM所接受的语言}; D. NP={L|L是一个能在多项式时间内被一台NDTM所接受的语言};14. 记号O的定义正确的是(A)。 A. O(g(n)) = { f(n) | 存在正常数c和n0使得对所有nn有:0 f(n) ,,,0 cg(n) }; B. O(g(n)) = { f(n) | 存在正常数c和n0使得对所有nn有:0 cg(n) ,,,0 f(n) }; used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional C. O(g(n)) = { f(n) | 对于任何正常数c>0,存在正数和n>0使得对所有nn0 0, 有:0 f(n)0,存在正数和n >0使得对所有0 nn有:0 cg(n) < f(n) }; 0,, 15. 记号的定义正确的是(B)。 , A. O(g(n)) = { f(n) | 存在正常数c和n0使得对所有nn有:0 f(n) 0,,, cg(n) }; B. O(g(n)) = { f(n) | 存在正常数c和n0使得对所有nn有:0 cg(n) 0,,, f(n) }; C. (g(n)) = { f(n) | 对于任何正常数c>0,存在正数和n>0使得对所有nn0 ,0 有:0 f(n)0,存在正数和n >0使得对所有nn,00 cg(n) < f(n) }; 有:0 , 二、 填空题 21. 下面程序段的所需要的计算时间为( )。 O(n) int MaxSum(int n, int *a, int &besti, int &bestj) { int sum=0; for(int i=1;i<=n;i++){ int thissum=0; for(int j=i;j<=n;j++){ thissum+=a[j]; if(thissum>sum) { sum=thissum; besti=i; bestj=j; } } } return sum; } used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional 2. 有11个待安排的活动,它们具有下表所示的开始时间与结束时间,如果 以贪心算法求解这些活动的最优安排(即为活动安排问题:在所给的活 动集合中选出最大的相容活动子集合),得到的最大相容活动子集合为活 动( {1,4,8,11} )。 i 1 2 3 4 5 6 7 8 9 10 11 S[i] 1 3 0 5 3 5 6 8 8 2 12 f[i] 4 5 6 7 8 9 10 11 12 13 14 3. 所谓贪心选择性质是指(所求问题的整体最优解可以通过一系列局部最 优的选择,即贪心选择来达到)。 4. 所谓最优子结构性质是指(问题的最优解包含了其子问题的最优解)。 5. 回溯法是指(具有限界函数的深度优先生成法)。 6. 用回溯法解题的一个显著特征是在搜索过程中动态产生问题的解空间。在 任何时刻,算法只保存从根结点到当前扩展结点的路径。如果解空间树 中从根结点到叶结点的最长路径的长度为h(n),则回溯法所需的计算空 间通常为(O(h(n)))。7. 回溯法的算法框架按照问题的解空间一般分为 (子集树)算法框架与(排列树)算法框架。 8. 用回溯法解0/1背包问题时,该问题的解空间结构为(子集树)结构。 used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional 9.用回溯法解批处理作业调度问题时,该问题的解空间结构为(排列树)结 构。 10.用回溯法解0/1背包问题时,计算结点的上界的函数如下所示,请在空格 中填入合适的内容: Typep Knap::Bound(int i) {// 计算上界 Typew cleft = c - cw; // 剩余容量 Typep b = cp; // 结点的上界 // 以物品单位重量价值递减序装入物品 while (i <= n && w[i] <= cleft) { cleft -= w[i]; b += p[i]; i++; } // 装满背包 if (i <= n) (b += p[i]/w[i] * cleft); 11. 用回溯法解布线问题时,求最优解的主要程序段如下。如果布线区域划分为 return b; 的方格阵列,扩展每个结点需O(1)的时间,L为最短布线路径的长度,则nm,} 算法共耗时 ( O(mn) ),构造相应的最短距离需要(O(L))时间。 for (int i = 0; i < NumOfNbrs; i++) { nbr.row = here.row + offset[i].row; nbr.col = here.col + offset[i].col; if (grid[nbr.row][nbr.col] == 0) { // 该方格未标记 grid[nbr.row][nbr.col] = grid[here.row][here.col] + 1; if ((nbr.row == finish.row) && (nbr.col == finish.col)) break; // 完成布线 Q.Add(nbr);} } 12. 用回溯法解图的m着色问题时,使用下面的函数OK检查当前扩展结点的used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional 每一个儿子所相应的颜色的可用性,则需耗时(渐进时间上限)(O(mn))。 Bool Color::OK(int k) {// for(int j=1;j<=n;j++) if((a[k][j]= =1)&&(x[j]= =x[k])) return false; return true; } 13. 旅行售货员问题的解空间树是(排列树)。解答题 1. 机器调度问题。 问题描述:现在有n件任务和无限多台的机器,任务可以在机器上得到处理。每件任务的开始时间为s,完成时间为f,s方案
。 问题实例:若任务占用的时间范围是{[1,4],[2,5],[4,5],[2,6],[4,7]},则按时完成所有任务最少需要几台机器,(提示:使用贪心算法) 画出工作在对应的机器上的分配情况。 f(n)bf(n1)g(n),,,,2. 已知非齐次递归方程: ,其中,b、c是常数,,f(0)c,, n,nnig(n)是n的某一个函数。则f(n)的非递归表达式为:。 f(n)cbbg(i),,,,i1 h(n)2h(n1)1,,,,现有Hanoi塔问题的递归方程为: ,求h(n)的非递归表,h(1)1,, used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional 达式。 解:利用给出的关系式,此时有:b=2, c=1, g(n)=1, 从n递推到1,有: n1,n1n1i,,,h(n)cbbg(i),,,i1, n1n22,, ,,,,,,22...221 n,,21 3. 单源最短路径的求解。 问题的描述:给定带权有向图(如下图所示)G =(V,E),其中每条边的权是非负实数。另外,还给定V中的一个顶点,称为源。现在要计算从源到所有其它各顶点的最短路长度。这里路的长度是指路上各边权之和。这个问题通常称为单源最短路径问题。 解法:现采用Dijkstra算法计算从源顶点1到其它顶点间最短路径。请将此过程填入下表中。 迭代 S u dist[2] dist[3] dist[4] dist[5] 初始 {1} - 10 maxint 30 100 1 4. 请写出用回溯法解装载问题的函数。 2 装载问题:有一批共n个集装箱要装上2艘载重量分别为c1和c2的轮船,3 n4 wcc,,,i12,i1其中集装箱i的重量为wi,且。装载问题要求确定是否有一个合理的装载方案可将这n个集装箱装上这2艘轮船。如果有,找出一种装载方案。 解:void backtrack (int i) {// 搜索第i层结点 if (i > n) // 到达叶结点 更新最优解bestx,bestw;return; r -= w[i]; used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional if (cw + w[i] <= c) {// 搜索左子树 x[i] = 1; cw += w[i]; backtrack(i + 1); cw -= w[i]; } if (cw + r > bestw) { x[i] = 0; // 搜索右子树 backtrack(i + 1); } r += w[i]; }5. 用分支限界法解装载问题时,对算法进行了一些改进,下面的程序段给出了改进部分;试斜线部分完成什么功能,以及这样做的原因,即采用这样的方式,算法在执行上有什么不同。 // 检查左儿子结点 Type wt = Ew + w[i]; // 左儿子结点的重量 if (wt <= c) { // 可行结点 if (wt > bestw) bestw = wt; // 加入活结点队列 if (i < n) Q.Add(wt); } // 检查右儿子结点 if (Ew + r > bestw && i < n) Q.Add(Ew); // 可能含最优解 Q.Delete(Ew); // 取下一扩展结点 解答:斜线标识的部分完成的功能为:提前更新bestw值; 这样做可以尽早的进行对右子树的剪枝。具体为:算法Maxloading初始时将bestw设置为0,直到搜索到第一个叶结点时才更新bestw。因此在算法搜索到第一个叶子结点之前,总有bestw=0,r>0 故Ew+r>bestw总是成立。也就是说,此时右子树测试不起作用。 为了使上述右子树测试尽早生效,应提早更新bestw。又知算法最终找到的最优值是所求问题的子集树中所有可行结点相应重量的最大值。而结点所相应得重量仅在搜索进入左子树是增加,因此,可以在算法每一次进入左子树时更新bestw的值。 7. 最长公共子序列问题:给定2个序列X={x1,x2,„,xm}和Y={y1,y2,„,yn},找出X和Y的最长公共子序列。 used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional 由最长公共子序列问题的最优子结构性质建立子问题最优值的递归关系。用c[i][j]记录序列Xi和Yj的最长公共子序列的长度。其中, Xi={x1,x2,„,xi};Yj={y1,y2,„,yj}。当i=0或j=0时,空序列是Xi和Yj的最长公共子序列。故此时C[i][j]=0。其它情况下,由最优子结构性质可建立 ,00,0ij,, ,递归关系如下: cijcijijxy[][][1][1]1,0;,,,,,,,ij ,max{[][1],[1][]},0;cijcijijxy,,,,ij, 在程序中,b[i][j]记录C[i][j]的值是由哪一个子问题的解得到的。 (1) 请填写程序中的空格,以使函数LCSLength完成计算最优值的功能。 void LCSLength(int m,int n,char *x,char *y,int **c,int **b) { int i,j; for (i = 1; i <= m; i++) c[i][0] = 0; for (i = 1; i <= n; i++) c[0][i] = 0; for (i = 1; i <= m; i++) for (j = 1; j <= n; j++) { if (x[i]==y[j]) { c[i][j]=c[i-1][j-1]+1; b[i][j]=1;} else if (c[i-1][j]>=c[i][j-1]) { c[i][j]=c[i-1][j]; b[i][j]=2;} else { c[i][j]=c[i][j-1]; b[i][j]=3; } } } (2) 函数LCS实现根据b的内容打印出Xi和Yj的最长公共子序列。请填 写程序中的空格,以使函数LCS完成构造最长公共子序列的功能(请 将b[i][j]的取值与(1)中您填写的取值对应,否则视为错误)。 void LCS(int i,int j,char *x,int **b) { if (i ==0 || j==0) return; if (b[i][j]== 1) { LCS(i-1,j-1,x,b); cout<0 ) { printf("%d\n ",k); f(k-1); f(k-1); } } 《算法分析与设计》试题库(二) 一、简要回答下列问题 : 1. 算法重要特性是什么, 2. 算法分析的目的是什么, 3. 算法的时间复杂性与问题的什么因素相关, 4. 算法的渐进时间复杂性的含义, 5. 最坏情况下的时间复杂性和平均时间复杂性有什么不同, used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional 6. 简述二分检索(折半查找)算法的基本过程。 7. 背包问题的目标函数和贪心算法最优化量度相同吗, 8. 采用回溯法求解的问题,其解如何表示,有什么规定, 9. 回溯法的搜索特点是什么, 10.n皇后问题回溯算法的判别函数place的基本流程是什么, 11.为什么用分治法设计的算法一般有递归调用, 12.为什么要分析最坏情况下的算法时间复杂性, 13.简述渐进时间复杂性上界的定义。 14.二分检索算法最多的比较次数, 15.快速排序算法最坏情况下需要多少次比较运算, 16.贪心算法的基本思想, 17.回溯法的解(x,x,„„x)的隐约束一般指什么, 12n 18.阐述归并排序的分治思路。 19.快速排序的基本思想是什么。 20.什么是直接递归和间接递归,消除递归一般要用到什么数据结构, 21.什么是哈密顿环问题, 22.用回溯法求解哈密顿环,如何定义判定函数, 23.请写出prim算法的基本思想。 参考答案:1. 确定性、可实现性、输入、输出、有穷性 2. 分析算法占用计算机资源的情况,对算法做出比较和评价,设计出额更好的算法。 3. 算法的时间复杂性与问题的规模相关,是问题大小n的函数。 4(当问题的规模n趋向无穷大时,影响算法效率的重要因素是T(n)的数量级,而其他因素仅是使时间复杂度相差常数倍,因此可以用T(n)的数量级(阶)评价算法。时间复杂度T(n)的数量级(阶)称为渐进时间复杂性。 5. 最坏情况下的时间复杂性和平均时间复杂性考察的是n固定时,不同输入实例下的算法所耗时间。最坏情况下的时间复杂性取的输入实例中最大的时间复杂度: W(n) = max{ T(n,I) } , I?Dn 平均时间复杂性是所有输入实例的处理时间与各自概率的乘积和: A(n) =?P(I)T(n,I) I?Dn . 设输入是一个按非降次序排列的元素表A[i:j] 和x,选取A[(i+j)/2]6 与x比较,如果A[(i+j)/2]=x,则返回(i+j)/2,如果A[(i+j)/2]标准
;然后按这种量度标准对这n个输入排序,依次选择输入量加入部分解中。如果当前这个输入量的加入,不满足约束条件,则不把此输入加到这部分解中。 17(回溯法的解(x,x,„„x)的隐约束一般指个元素之间应满足的某种12n 关系。 18. 讲数组一分为二,分别对每个集合单独排序,然后将已排序的两个序列归并成一个含n个元素的分好类的序列。如果分割后子问题还很大,则继续分治,直到一个元素。 19.快速排序的基本思想是在待排序的N个记录中任意取一个记录,把该记录放在最终位置后,数据序列被此记录分成两部分。所有关键字比该记录关键字小的放在前一部分,所有比它大的放置在后一部分,并把该记录排在这两部分的中间,这个过程称作一次快速排序。之后重复上述过程,直到每一部分内只有一个记录为止。 20.在定义一个过程或者函数的时候又出现了调用本过程或者函数的成分,既调用它自己本身,这称为直接递归。如果过程或者函数P调用过程或者函数Q,Q又调用P,这个称为间接递归。消除递归一般要用到栈这种数据结构。 21.哈密顿环是指一条沿着图G的N条边环行的路径,它的访问每个节点一次并且返回它的开始位置。 22.当前选择的节点X[k]是从未到过的节点,即X[k]?X[i](i=1,2,„,k-1),且C(X[k-1], X[k])??,如果k=-1,则C(X[k], X[1]) ??。 23. 思路是:最初生成树T为空,依次向内加入与树有最小邻接边的n-1条边。处理过程:首先加入最小代价的一条边到T,根据各节点到T的邻接边排序,选择最小边加入,新边加入后,修改由于新边所改变的邻接边排序,再选择下一条边加入,直至加入n-1条边。 二、复杂性分析 1、MERGESORT(low,high) if lowM then return endif a?a+i i?i+1 ; repeat end 解: i?1 ;s?0 时间为:O(1) while i? n do 循环n次 循环体内所用时间为 O(1) 所以 总时间为: T(n)=O(1)+ nO(1)= O(n) 3.procedure PARTITION(m,p) Integer m,p,i;global A(m:p-1) v?A(m);i?m loop loop i?i+1 until A(i) ?v repeat loop p?p-1 until A(p) ?v repeat if i

1时F1(n)的时间复杂度与F2(2,n,1,1)的时间复杂度相同即为为 O(n) 5.procedure MAX(A,n,j) xmax?A(1);j?1 for i?2 to n do if A(i)>xmax then xmax?A(i); j?i;endif repeat end MAX 解:xmax?A(1);j?1 时间为:O(1) for i?2 to n do 循环最多n-1次 所以 总时间为: T(n)=O(1)+ (n-1)O(1)= O(n) 6.procedure BINSRCH(A,n,x,j) integer low,high,mid,j,n; low?1;high?n while low?high do mid?|_(low+high)/2_| case :xA(mid):low?mid+1 :else:j?mid; return endcase repeat j?0 end BINSRCH 解:log2n+1 三、算法理解 1、写出多段图最短路经动态规划算法求解下列实例的过程,并求出最优值。 2 5 1 3 6 8 used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional 4 7 各边的代价如下: C(1,2)=3, C(1,3)=5 ,C(1,4)=2 C(2,6)=8 ,C(2,7)=4 ,C(3,5)=5 ,C(3,6)=4, C(4,5)=2,C(4,6)=1 C(5,8)=4, C(6,8)=5 ,C(7,8)=6 解:Cost(4,8)=0 Cost(3,7)= C(7,8)+0=6 ,D[5]=8 Cost(3,6)= C(6,8)+0=5, D[6]=8 Cost(3,5)= C(5,8)+0=4 D[7]=8 Cost(2,4)= min{C(4,6)+ Cost(3,6), C(4,5)+ Cost(3,5)} = min{1+ 5, 2+4}=6 D[4]=6 Cost(2,3)= min{C(3,6)+ Cost(3,6) } = min{4+5}=9 D[3]=5 Cost(2,2)= min{C(2,6)+ Cost(3,6), C(2,7)+ Cost(3,7)} = min{8+5, 4+6}=10 D[2]=7 ost(1,1)= min{C(1,2)+ Cost(2,2), C(1,3)+ Cost(2,3), C(1,4)+ C Cost(2,4)} = min{3+10, 5+9,2+6}= 8 D[1]=4 1?4?6?8 2、写出maxmin算法对下列实例中找最大数和最小数的过程。 数组 A=(48,12,61,3,5,19,32,7) 解:写出maxmin算法对下列实例中找最大数和最小数的过程。 数组 A=() 1、 48,12,61,3, 5,19,32,7 2、48,12 61,3 5,19 32,7 3、 48,61, 12,3 19,32,5,7 4、 61,32 3,5 5、 61 3 3、快速排序算法对下列实例排序,算法执行过程中,写出数组A第一次被分 割的过程。 A=(65,70,75,80,85,55,50,2) 解:第一个分割元素为65 (1) (2) (3) (4) (5) (6) (7) (8) i p 65 70 75 80 85 55 50 2 2 8 65 2 75 80 85 55 50 70 3 7 65 2 50 80 85 55 75 70 4 6 65 2 50 55 85 80 75 70 4 6 used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional 55 70 75 80 85 65 50 2 4、 归并排序算法对下列实例排序,写出算法执行过程。 A=(48,12,61,3,5,19,32,7) 解: 48,12,61,3 5,19,32,7 48,12 61,3 5,19 32,7 12,48 3,61 5,19 7,32 3, 12, 48, 61 5, 7, 19,32 3,5, 7,12,19,32,48,61 5、写出图着色问题的回溯算法的判断X[k]是否合理的过程。 解:i?0 while iCU: x[3]?CU/ W[3]=3/8; 实例的解为:(1,1,3/8,0) 11、有一个有序表为{1,3,9,12,32,41,45,62,75,77,82,95,100},当使用二分查找值为82的结点时,经过多少次比较后查找成功并给出过程。 解:有一个有序表为{1,3,9,12,32,41,45,62,75,77,82,95,100},当使用二分查找值为82的结点时,经过多少次比较后查找成功并给出过程。 一共要要执行四次才能找到值为82的数。 12、使用prim算法构造出如下图G的一棵最小生成树。 used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional 1 2 4 3 6 5 dist(1,2)=6;dist(2,5)=3;dist(5,6)=6;dist(6,4)=2;dist(4,1)=5; dist(1,3)=1;dist(2,3)=5;dist(3,4)=5;dist(3,6)=4;dist(5,3)=6 解:使用普里姆算法构造出如下图G的一棵最小生成树。 1 2 4 3 6 5 dist(1,2)=6;dist(2,5)=3;dist(5,6)=6;dist(6,4)=2;dist(4,1)=5; dist(1,3)=1;dist(2,3)=5;dist(3,4)=5;dist(3,6)=4;dist(5,3)=6 1 1 1 4 3 3 3 6 6 1 1 4 2 2 4 3 3 5 6 6 used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional 13、有如下函数说明 int f(int x,int y) { f=x Mod y +1; } 已知a=10,b=4,c=5 则执行k=f(f(a+c,b),f(b,c))后,k的值是多少并写出详细 过程。 解:有如下函数说明 int f(int x,int y) { f=x Mod y +1; } 已知a=10,b=4,c=5 则执行k=f(f(a+c,b),f(b,c))后,k的值是多少并写出详细 过程。 } K的值是5 14、McCathy函数定义如下: 当x>100时 m(x)=x-10; 当x<=100时 m(x)=m(m(x+11)); 编写一个递归函数计算给定x的m(x)值。 解:McCathy函数定义如下: 当x>100时 m(x)=x-10; 当x<=100时 m(x)=m(m(x+11)); 编写一个递归函数计算给定x的m(x)值。 int m(int x) { int y; if(x>100) return(x-100); else { y=m(x+11); return (m(y)); } } 15、 设计一个算法在一个向量A中找出最大数和最小数的元素。 解:设计一个算法在一个向量A中找出最大数和最小数的元素。 Void maxmin(A,n) Vector A; int n; { used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional int max,min,i; max=A[1];min=A[1]; for(i=2;i<=n;i++) if(A[i]>max)max=A[i]; else if(A[i]cu then exit endif X(i) ?1 cu?cu-W(i) repeat end GREEDY-KNAPSACK 根据算法得出的解: X=(1,1,1,1,1,0,0)获利润52, 而解 (1,1,1,1, 0, 1,0)可获利润54 因此贪心法不一定获得最优解。 4. 设计只求一个哈密顿环的回溯算法。 解:Hamiltonian(n) {k?1; x[k] ?0; While k>0 do x[k] ? x[k]+1; while B(k)=false and x[k]?n do x[k] ? x[k]+1; repeat If x[k]?n then if k=n then {print x; return} else {k? k+1; x[k]?0;} endif else k? k-1 endif repeat end procedure B(k) { G[x[k-1],x[k] ]?1 then return false; for i?1 to k-1 do if x[i]=x[k] then return false;endif repeat return true; } 5(利用对称性设计算法,求n为偶数的皇后问题所有解。 解:利用对称性设计算法,求n为偶数的皇后问题所有解。 used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional procedure NQUEENS1(n) a?0 //计数器清零 X(1)?0;k?1 //k是当前行;X(k)是当前列// While k>0 do //对所有的行执行以下语句// 1) { X(k)?X(k)+1 //移到下一列// While X(k)?n and not PLACE(k) do 2) X(k)?X(k)十l if X(k)?n then if k=n / then {print(X),a?a+1 //找到一个解计数器a加1// if a=n/2 then return // 找到n/2个解算法结束 3) else {k?k+1;X(k)?0;} 4) else k?k,1 //回溯// } end NQUEENS 《算法分析与设计》试题库(三) 1、对于下列各组函数f(n)和g(n),确定f(n)=O(g(n))或或f(n),,(g(n)) ,并简述理由。(12分) f(n),,(g(n)) 2(1) f(n),logn;g(n),logn,5; n2(2) f(n),2;g(n),100n; nn(3) f(n),2;g(n),3; 解:简答如下: 2n2nn (1),(2),(3) logn,,(logn,5)2,,(100n)2,;(3) R,{r,r,...,r)n2、试用分治法实现有重复元素的排列问题:设是要进行排列的12n Rr,r,...,r个元素,其中元素可能相同,试计算的所有不同排列。(13分) 12n 解:解答如下: Template used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional void Perm(Type list[],int k,int m) { if(k= =m){ for(int i=0;i<=m;i++) cout< int ok(Type list[],int k,int i) { if(i>k) for(int t=k;t int BinarySearch(Type a[],const Type& x,int n) {//假定数组a[]已按非递减有序排列,本算法找到x后返回其在数组a[]中 的位置,//否则返回-1 int left=0,right=n-1; while(left<=right){ int middle=(left+right)/2; ……………………………..(4分) if(x= =a[middle]) return middle+1; if(x>a[middle]) left=middle+1; ……………………………..(8分) else right=middle-1; } return -1; }……………………………..(12分) 4、试用动态规划算法实现0-1闭包问题。(15分) 解:解答如下: Template void Knapsack(Type v,int w,int c,int n,Type **m) { used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional Int jMax=min(w[n]-1,c); for(int j=0;j<=jMax;j++) m[n][j]=0; for(int j=w[n];j<=c;j++) m[n][j]=v[n]; ……………………………..(5分) for(int i=n-1;i>1;i--){ jMax=min(w[i]-1,c); for(int j=0;j<=jMax;j++) m[i][j]=m[i+1][j]; for(int j=w[i];j<=c;j++) m[i][j]=max(m[i+1][j],m[i+1][j-w[i]]+v[i]); …………..(8分) }; m[1][c]=m[2][c]; if(c>=w[1]) m[1][c]=max(m[1][c],m[2][c-w[1]]+v[1]); …………..(10分) } Template Void Traceback(Type **m,int w,int c,int n,int x) { for(int i=1;ia[k]){ k++; a[k]=a[k-1]+1; n-=a[k]; };……………………………..(10分) if(n= =a[k]){ a[k]++;n--;}; for(int i=0;isum) sum=max; } } return sum; ……………………………..(10分) } int MaxSum(int n,int *a) { int sum=0,b=0; for(int i=1;i<=n;i++){ if(b>0) b+=a[i]; else b=a[i]; if(b>sum) sum=b; } Return sum; ……………………………..(15分) } i7、试用回溯法解决下列整数变换问题:关于整数的变换和g定义如下:f 。对于给定的两个整数和,要求用最少的变换和g变f(i),3i;g(i),i/2nmf,, 换次数将变为。(18分) nm 解:解答如下: void compute() { k=1; while(!search(1,n)){ k++; if(k>maxdep) break; init(); };……………………………..(6分) if(found) output(); else cout<<”No Solution!”<k) return false; for(int i=0;i<2;i++){ used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional int n1=f(n,i);t[dep]=i; ……………………………..(12分) if(n1= =m||search(dep+1,n1)){ Found=true; Out(); return true; } return false; ……………………………..(18分) } 《算法分析与设计》试题库(四) 一、 排序和查找是经常遇到的问题。按照要求完成以下各题:(20分) (1) 对数组A={15,29,135,18,32,1,27,25,5},用快速排序方法 将其排成递减序。 (2) 请描述递减数组进行二分搜索的基本思想,并给出非递归算法。 (3) 给出上述算法的递归算法。 (4) 使用上述算法对(1)所得到的结果搜索如下元素,并给出搜索过程: 18,31,135。 答案:(1)第一步:15 29 135 18 32 1 27 25 5 第二步:29 135 18 32 27 25 15 1 5 【1分】 第三步:135 32 29 18 27 25 15 5 1 【1分】 第四步:135 32 29 27 25 18 15 5 1 【1分】 used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional n,,(2)基本思想:首先将待搜索元素v与数组的中间元素进行比较,如果A,,2,, nn,,,,,则在前半部分元素中搜索v;若,则搜索成功;否则在后半vA,vA,,,,,22,,,, 部分数组中搜索v。【2分】 非递归算法: 输入:递减数组A[left:right],待搜索元素v。【1分】 输出:v在A中的位置pos,或者不在A中的消息(-1)。【1分】 步骤:【3分】 int BinarySearch(int A[],int left,int right,int v) { int mid; while (left<=right) { mid=int((left+right)/2); if (v==A[mid]) return mid; else if (v>A[mid]) right=mid-1; else left=mid+1; } return -1; } (3)递归算法: [left:right],待搜索元素v。【1分】 输入:递减数组A 输出:v在A中的位置pos,或者不在A中的消息(-1)。【1分】 步骤:【3分】 int BinarySearch(int A[],int left,int right,int v) { int mid; if (left<=right) { mid=int((left+right)/2); if (v==A[mid]) return mid; else if (v>A[mid]) return BinarySearch(A,left,mid-1,v); else return BinarySearch(A,mid+1,right,v); } else return -1; } (4)搜索18:首先与27比较,18<27,在后半部分搜索;再次与18比较,搜索到,返回5。【1分】 搜索31:首先与27比较,31>27,在前半部分搜索;再次32比较,31<32,在后半部分搜索,与29比较,31>29,此时只有一个元素,未找到,返回-1。【2used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional 分】 搜索135:首先与27比较,135>27,在前半部分搜索;再次32比较,135>32,在前半部分搜索;与135比较,相同,返回0。【2分】 二、 对于下图使用Dijkstra算法求由顶点a到顶点h的最短路径。(20分)。 beg2 221 323ad 821 2cfh 答案:用V表示已经找到最短路径的顶点,V表示与V中某个顶点相邻接且121 不在V中的顶点;E表示加入到最短路径中的边,E为与V中的顶点相邻接1121 且距离最短的路径。【1分】 步骤 V V E E 1212 1. {a} {b} {} {ab} {a,b} {d} {ab} {bd} 2. 3. {a,b,d} {c,f} {ab,bd} {dc,df} 4. {a,b,d,c} {f} {ab,bd} {df} 5. {a,b,c,d,f} {e} {ab,bd,dc,df} {fe} 6. {a,b,c,d,e,f} {g} {ab,bd,dc,df,fe} {eg} 7. {a,b,c,d,e,f,g} {h} {ab,bd,dc,df,fe,eg} {gh} 8. {a,b,c,d,e,f,g,h} {} {ab,bd,de,df,fe,eg,gh} {} 【以上每步2分】 结果:从a到h的最短路径为abdfegh,,,,,,,权值为18。【1分】 三、 假设有7个物品,它们的重量和价值如下表所示。若这些物品均不能被分割,且背包容量M,150,使用回溯方法求解此背包问题。请写出状态空间搜索树(20分)。 物品 A B C D E F G 重量 35 30 60 50 40 10 25 价值 10 40 30 50 35 40 30 答案:求所有顶点对之间的最短路径可以使用Dijkstra算法,使其起始节点从a循环到h,每次求起始节点到其他节点的最短路径,最终可以求得所有顶点对之间的最短路径。【2分】 三、按照单位效益从大到小依次排列这7个物品为:FBGDECA。将它们的序号分别记为1,7。则可生产如下的状态空间搜索树。其中各个节点处的限界函数值通过如下方式求得:【排序1分】 used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional ax,11x,01ajx,12x,02aix,13 ax,03x,14x,04 ade x,14x,0x,054 behx,15x,0x,065egcx,06x,07fQ1 【状态空间搜索树及其计算过程17分,每个节点1分】 150115,7a( 4040305035190.625,,,,,,(1,1,1,1,,0,0)408 150115,7b. 4040305030177.5,,,,,,(1,1,1,1,0,,0)6012 c(4040305010170,,,,,(1,1,1,1,0,0,1) 150105,3d. 4040303530167.5,,,,,,(1,1,1,0,1,,0)604 150130,1e. 4040503530175,,,,,,(1,1,0,1,1,,0)603 150130,f. 44040503510170.71,,,,,,(1,1,0,1,1,0,)357 40405030160,,,,g. (1,1,0,1,0,1,0) 150140,2h. 4040353010146.85,,,,,,(1,1,0,0,1,1,)357 150125,5i. 4030503530167.5,,,,,,(1,0,1,1,1,,0)6012 150145,1j. 4030503530157.5,,,,,,(0,1,1,1,1,,0)6012 在Q处获得该问题的最优解为,背包效益为170。即在背包中装入(1,1,1,1,0,0,1)1 物品F、B、G、D、A时达到最大效益,为170,重量为150。【结论2分】 ()kAa,()四、 已知,k=1,2,3,4,5,6,r=5,r=10,r=3,r=12,1234kijrr*ii,1 r=5,r=50,r=6,求矩阵链积A×A×A×A×A×A的最佳求积顺序。(要567123456求:给出计算步骤)(20分) used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional 答案:使用动态规划算法进行求解。 求解矩阵为:【每个矩阵18分】 1 2 3 4 5 6 1 0 150 330 405 1655 2010 2 0 360 330 2430 1950 3 0 180 930 1770 4 0 3000 1860 5 0 1500 6 0 1 2 3 4 5 6 1 0 1 2 2 4 2 2 0 2 2 2 2 3 0 3 4 4 4 0 4 4 5 0 5 6 0 因此,最佳乘积序列为(AA)((AA)(AA)),共执行乘法2010次。【结123456 论2分】 五、回答如下问题:(20分) (1) 什么是算法,算法的特征有哪些, (2) 什么是P类问题,什么是NP类问题,请描述集合覆盖问题的近似算 法的基本思想。 答案:(1)算法是解决某类问题的一系列运算的集合【2分】。具有有穷行、可行性、确定性、0个或者多个输入、1个或者多个输出【8分】。 (2)用确定的图灵机可以在多项式实践内可解的判定问题称为P类问题【2分】。用不确定的图灵机在多项式实践内可解的判定问题称为P类问题。【2分】 集合覆盖问题的近似算法采用贪心思想:对于问题,每次选择F中覆盖了尽可能多的未被覆盖元素的子集S,然后将U中被S覆盖的元素删除,并将S加入C中,最后得到的C就是近似最优解。【6分】 used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional 《算法分析与设计》试题库(五) 一、 填空题(本题15分,每小题1分) 1、算法就是一组有穷的 ,它们规定了解决某一特定类型问题 的 。 2、在进行问题的计算复杂性分析之前,首先必须建立求解问题所用的计算模 型。3个基本计算模型是 、 、 。 3、算法的复杂性是 的度量,是评价算法优劣的重要依据。 4、计算机的资源最重要的是 和 资源。因而,算法的复杂性有 和 之分。 n25、f(n)= 6×2+n,f(n)的渐进性态f(n)= O( ) 6、贪心算法总是做出在当前看来 的选择。也就是说贪心算法并不从整 体最优考虑,它所做出的选择只是在某种意义上的 。 7、许多可以用贪心算法求解的问题一般具有2个重要的性质: 性质 和 性质。 used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional 二、简答题(本题25分,每小题5分) 1、 简单描述分治法的基本思想。 2、 简述动态规划方法所运用的最优化原理。 3、 何谓最优子结构性质, 4、 简单描述回溯法基本思想。 5、 何谓P、NP、NPC问题 三、算法填空(本题20分,每小题5分) 1、n后问题回溯算法 (1)用二维数组A[N][N]存储皇后位置,若第i行第j列放有皇后,则A[i][j]为非0 值,否则值为0。 (2)分别用一维数组M[N]、L[2*N-1]、R[2*N-1]表示竖列、左斜线、右斜线是 否放有棋子,有则值为1,否则值为0。 for(j=0;j=0;r--) //自底向上递归计算 for(c=0; 1 ;c++) if( t[r+1][c]>t[r+1][c+1]) 2 ; else 3 ; 3、Hanoi算法 Hanoi(n,a,b,c) if (n==1) 1 ; else { 2 ; 3 ; Hanoi(n-1,b, a, c); } 4、Dijkstra算法求单源最短路径 d[u]:s到u的距离 p[u]:记录前一节点信息 Init-single-source(G,s) for each vertex v?V[G] do { d[v]=?; 1 } d[s]=0 used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional Relax(u,v,w) if d[v]>d[u]+w(u,v) then { d[v]=d[u]+w[u,v]; 2 } dijkstra(G,w,s) 1. Init-single-source(G,s) 2. S=Φ 3. Q=V[G] 4.while Q<> Φ do u=min(Q) S=S?{u} for each vertex 3 do 4 四、算法理解题(本题10分) 根据优先队列式分支限界法,求 下图中从v1点到v9点的单源最 短路径,请画出求得最优解的解 空间树。要求中间被舍弃的结点 用×标记,获得中间解的结点用 单圆圈?框起,最优解用双圆圈 ◎框起。 五、算法理解题(本题5分) k设有n=2个运动员要进行循环赛,现设计一个满足以下要求的比赛日程表: ?每个选手必须与其他n-1名选手比赛各一次; ?每个选手一天至多只能赛一次; ?循环赛要在最短时间内完成。 k(1)如果n=2,循环赛最少需要进行几天; 3(2)当n=2=8时,请画出循环赛日程表。 六、算法设计题(本题15分) 分别用贪心算法、动态规划法、回溯法设计0-1背包问题。要求:说明所使 用的算法策略;写出算法实现的主要步骤;分析算法的时间。 七、算法设计题(本题10分) 通过键盘输入一个高精度的正整数n(n的有效位数?240),去掉其中任意s个 数字后,剩下的数字按原左右次序将组成一个新的正整数。编程对给定的n 和s, 寻找一种方案,使得剩下的数字组成的新数最小。 【样例输入】 178543 S=4 【样例输出】 13 标准答案 used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional 一、填空题(本题15分,每小题1分) 1. 规则 一系列运算 2. 随机存取机RAM(Random Access Machine);随机存取存储程序机RASP(Random Access Stored Program Machine);图灵机(Turing Machine) 3. 算法效率 4. 时间、空间、时间复杂度、空间复杂度 n (2 5 6(最好 局部最优选择 7. 贪心选择 最优子结构 二、简答题(本题25分,每小题5分) 6、分治法的基本思想是将一个规模为n的问题分解为k个规模较小的子问题, 这些子问题互相独立且与原问题相同;对这k个子问题分别求解。如果子 问题的规模仍然不够小,则再划分为k个子问题,如此递归的进行下去, 直到问题规模足够小,很容易求出其解为止;将求出的小规模的问题的解 合并为一个更大规模的问题的解,自底向上逐步求出原来问题的解。 7、“最优化原理”用数学化的语言来描述:假设为了解决某一优化问题,需要 依次作出n个决策D1,D2,…,Dn,如若这个决策序列是最优的,对于任 何一个整数k,1 < k < n,不论前面k个决策是怎样的,以后的最优决策 只取决于由前面决策所确定的当前状态,即以后的决策Dk+1,Dk+2,…, Dn也是最优的。 8、某个问题的最优解包含着其子问题的最优解。这种性质称为最优子结构性 质。 9、回溯法的基本思想是在一棵含有问题全部可能解的状态空间树上进行深度 优先搜索,解为叶子结点。搜索过程中,每到达一个结点时,则判断该结 点为根的子树是否含有问题的解,如果可以确定该子树中不含有问题的解, 则放弃对该子树的搜索,退回到上层父结点,继续下一步深度优先搜索过 程。在回溯法中,并不是先构造出整棵状态空间树,再进行搜索,而是在 搜索过程,逐步构造出状态空间树,即边搜索,边构造。 10、 P(Polynomial问题):也即是多项式复杂程度的问题。 NP就是Non-deterministic Polynomial的问题,也即是多项式复杂程度的 非确定性问题。 NPC(NP Complete)问题,这种问题只有把解域里面的所有可能都穷举了之 后才能得出答案,这样的问题是NP里面最难的问题,这种问题就是NPC问 题。 三、算法填空(本题20分,每小题5分) 1、n后问题回溯算法 (1) !M[j]&&!L[i+j]&&!R[i-j+N] (2) M[j]=L[i+j]=R[i-j+N]=1; (3) try(i+1,M,L,R,A) (4) A[i][j]=0 used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional (5) M[j]=L[i+j]=R[i-j+N]=0 2、数塔问题。 (1)c<=r (2)t[r][c]+=t[r+1][c] (3)t[r][c]+=t[r+1][c+1] 3、Hanoi算法 (1)move(a,c) (2)Hanoi(n-1, a, c , b) (3)Move(a,c) 4、(1)p[v]=NIL (2)p[v]=u (3) v?adj[u] (4)Relax(u,v,w) 四、算法理解题(本题10分) 五、(1)8天(2分); 3=8时,循环赛日程表(3分)。 (2)当n=2 1 2 3 4 5 6 7 8 2 1 4 3 6 5 8 7 3 4 1 2 7 8 5 6 4 3 2 1 8 7 6 5 5 6 7 8 1 2 3 4 6 5 8 7 2 1 4 3 7 8 5 6 3 4 1 2 8 7 6 5 4 3 2 1 六、算法设计题(本题15分) (1)贪心算法 O(nlog(n)) , 首先计算每种物品单位重量的价值Vi/Wi,然后,依贪心选择策略,将尽 可能多的单位重量价值最高的物品装入背包。若将这种物品全部装入背包 后,背包内的物品总重量未超过C,则选择单位重量价值次高的物品并尽 可能多地装入背包。依此策略一直地进行下去,直到背包装满为止。 , 具体算法可描述如下: void Knapsack(int n,float M,float v[],float w[],float x[]) used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional {Sort(n,v,w); int i; for (i=1;i<=n;i++) x[i]=0; float c=M; for (i=1;i<=n;i++) {if (w[i]>c) break; x[i]=1; c-=w[i]; } if (i<=n) x[i]=c/w[i]; } (2)动态规划法 O(nc) m(i,j)是背包容量为j,可选择物品为i,i+1,…,n时0-1背包问题的最优 值。由0-1背包问题的最优子结构性质,可以建立计算m(i,j)的递归式如下。 j,wmax{m(i,1,j),m(i,1,j,w),v},iiim(i,j),,0,j,wm(i,1,j)i, j,wv,nnm(n,j),,0,j,w0n, void KnapSack(int v[],int w[],int c,int n,int m[][11]) {int jMax=min(w[n]-1,c); for (j=0;j<=jMax;j++) /*m(n,j)=0 0==w[n]*/ m[n][j]=v[n]; for (i=n-1;i>1;i--) { int jMax=min(w[i]-1,c); for (j=0;j<=jMax;j++) /*m(i,j)=m(i+1,j) 0==w[n]*/ m[i][j]=max(m[i+1][j],m[i+1][j-w[i]]+v[i]); } m[1][c]=m[2][c]; if(c>=w[1]) m[1][c]=max(m[1][c],m[2][c-w[1]]+v[1]); } n(3)回溯法 O(2) cw:当前重量 cp:当前价值 bestp:当前最优值 void backtrack(int i) //回溯法 i初值1 { if(i> n) //到达叶结点 { bestp = cp; return; } used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional if(cw + w[i] <= c) //搜索左子树 { cw += w[i]; Cp += p[i]; backtrack(i+1); cw -= w[i]; cp -= p[i]; } if(Bound(i+1)>bestp) //搜索右子树 backtrack(i+1); } 七、算法设计题(本题10分) 为了尽可能地逼近目标,我们选取的贪心策略为:每一步总是选择一个使剩下的数最小的数字删去,即按高位到低位的顺序搜索,若各位数字递增,则删除最后一个数字,否则删除第一个递减区间的首字符。然后回到串首,按上述规则再删除下一个数字。重复以上过程s次,剩下的数字串便是问题的解了。 具体算法如下: 输入s, n; while( s > 0 ) { i=1; //从串首开始找 while (i < length(n)) && (n[i]1)&& (n[1]=„0?) delete(n,1,1); //删去串首可能产生的无用零 输出n; used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional 《算法分析与设计》试题库(六) 一(填空题(每空2分,共30分) 1(算法的时间复杂性指算法中 的执行次数。 ,,2(在忽略常数因子的情况下,O、和三个符号中, 提供了算法运 行时间的一个上界。 (设D3表示大小为n的输入集合,t(I)表示输入为I时算法的运算时间, p(I)n 表示输入I出现的概率,则算法的平均情况下时间复杂性 A(n)= 。 4(分治算法的时间复杂性常常满足如下形式的递归方程: f(n),d , n,n,0 ,f(n)af(n/c)g(n) , nn,,,0, used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional 其中,g(n)表示 。 5. 分治算法的基本步骤包括 。 6(回溯算法的基本思想是 。 7(动态规划和分治法在分解子问题方面的不同点是 。 8(贪心算法中每次做出的贪心选择都是 最优选择。 9(PQ式的分支限界法中,对于活结点表中的结点,其下界函数值越小,优先级 越 。 10(选择排序、插入排序和归并排序算法中, 算法是分治算法。 11(随机算法的一个基本特征是对于同一组输入, 不同的运行可能得到 的结果。 12.对于下面的确定性快速排序算法,只要在步骤3前加入随机化步 骤 ,就可得到一个随机化快速排序算法,该 随机化步骤的功能是 。 算法 QUICKSORT 输入:n个元素的数组A[1..n]。 输出:按非降序排列的数组A中的元素。 1. quicksort(1, n) end QUICKSORT 过程 quicksort(A, low, high) // 对A[low..high]中的元素按非降序排序。 2. if low0 then output i else output “no solution” end SEARCH 过程 find (low, high) // 求A[low..high] 中使得A[i]=i的一个下标并返回,若 不存在,//则返回0。 if (2) then return 0 else mid= (low,high)/2,, if (3) then return mid else if A[mid]high (3) A[mid]=mid (4) mid+1, high (5) find(low, mid-1) 2. (1) 0 (2) i+d (3) C[i, k-1]+C[k, j]+r[i]*r[k]*r[j+1] (4) C[i, j] (5) C[1, n] 3. (1) i>=1 (2)k[i]+1 (3) 1 (4) i+1 (5) k[i]=0 (6) tag[x, y]=0 (7) x=x-dx[k[i]]; y=y-dy[k[i]] 四. 算法设计题: 1. 贪心选择策略:从起点的加油站起每次加满油后不加油行驶尽可能远,直至 油箱中的油耗尽前所能到达的最远的油站为止,在该油站再加满油。 算法 MINSTOPS 输入:A、B两地间的距离s,A、B两地间的加油站数n,车加满油后可行 驶的公里数m,存储各加油站离起点A的距离的数组d[1..n]。 输出:从A地到B地的最少加油次数k以及最优解x[1..k](x[i]表示第i次 加油的加油站序号),若问题无解,则输出no solution。 d[n+1]=s; //设置虚拟加油站第n+1站。 for i=1 to n if d[i+1]-d[i]>m then output “no solution”; return //无解,返回 end if end for k=1; x[k]=1 //在第1站加满油。 s1=m //s1为用汽车的当前油量可行驶至的地点与A点的距离 i=2 used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional while s1s1 then //以汽车的当前油量无法到达第i+1站。 k=k+1; x[k]=i //在第i站加满油。 s1=d[i]+m //刷新s1的值 end if i=i+1 end while output k, x[1..k] MINSTOPS 最坏情况下的时间复杂性:Θ(n) 《算法分析与设计》试题库(七) 一、 填空题(10空×2分,共20分) 1、 算法在运行时占有的机器资源的量称为算法复杂性,主要包括( 时 间 )和( 空间 )。 2222、 当一个算法的运行时间为n+n+1时,由于n+n+1与n的数量级相等,则称 2n为这个算法的( 时间复杂度 )。 m2、 多项式A(n)=a3n+…+ an+ an+ a的上界为( )。 m210 4、 递归算法设计的关键在于找出( 递归关系 )和( 最小问题的 解 )。 5、 ( 无后向性 )是问题能用贪婪算法或动态规划方法求解的前提。 6、 拆半查找、合并排序、二叉树遍历等算法中均采用了( 分而治之 ) 策略。 7、 回溯算法是尝试搜索算法中最为基本的一种算法,其采用了一种走不通就掉 头的思想作为其控制结构 。 8、 用分支限界法解决布线问题时,对问题解空间搜索尝试结束的标志是 ( )。 二、 判断题(10题×2分,共20分) used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional 1. 若c是正常数,则O(cf(n))=O(f(n))。v 2. 在最好情况下、最坏情况下、平均情况下的时间复杂度中,可操作性最好的 且最有实际价值的,是最坏情况下的时间复杂度。x 3. 好的算法在很大程度上取决于问题中数据所采用的数据结构。v 4. 迭代模型是通过小规模问题的解逐步求解大规模问题的解,正好与递归算法 设计相反。v 5. 用贪婪算法解决零钱兑换问题时,总能找到问题的最优解。x 6. 适用动态规划算法解决问题应该具有最优化原理和子问题重叠。x 7. 深度优先搜索算法可以搜索到问题所有可能的解方案。x 8. 解决马的遍历问题采用回溯法,对解空间树的搜索采用广度优先搜索方式v 9. 分支限界法的求解目标是找出满足约束条件的一个解或是在满足约束条件 的解中找出使用某一目标函数值达到极大或极小的解。x 三、 简答题(3题×6分,共18分) 1、叙述分治算法和动态规划算法的基本思想,并比较两种算法的异同。 2、在算法设计的实际应用中,遇到的问题主要分为4类:判定性问题、计算问 题、最优化问题和构造性问题,请指出递归法、递推法、贪婪算法、分治法、 动态规划法、搜索算法各自适合解决的问题。 3、简述回溯法求解问题的一般步骤。 四、 程序填空题(6空×3分,共18分) 、找出n个自然数(1,2,3,…,n)中取r个数的组合。例如,当n=4,r=3时,1 所有的组合为: 4 3 2 4 3 1 4 2 1 3 2 1 以下是算法,请填空。 void comb(int n,int r) { int i,j; for(i=n; ? ; i--) { ? ; if(r>1) ? ; else { for(j=a[0]; j>0; j--) printf("%3d",a[j]); printf("\n"); } } } 2、走迷宫问题。迷宫是许多小方格构成的矩形,在每个小方格中有的是墙(用 used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional “1”表示)有的是路(用“0”表示)。走迷宫就是从一个小方格沿上、下、左、 右四个方向到邻近的方格,当然不能穿墙。设迷宫的入口是在左上角(1,1), 出口是右下角(8,8)。根据给定的迷宫,找出一条从入口到出口的路径。 数据结构:数组maze[8][8]存放迷宫;用数组fx[4]={1,-1,0,0},fy[4]={0,0,-1,1} 模拟上下左右搜索时的下标的变化过程;用迷宫原有的存储空间置元素值为“-1”时,标识已经访问过该方格。用数组做队的存储空间,队中的成员有三个:行号、列号、前一个方格在队列中的下标。 struct {int x,y,pre}sq[100]; search() { qh=0; qe=1; maze[1][1]= ? ; sq[1].pre=0; sq[1].x=1; sq[1].y=1; while( ? ) { qh=qh+1; for(k=1;k<=4;k++) { i=sq[qh].x+fx[k]; j=sq[qh].y+fy[k]; if (check(i,j)=1) //check()用来检查该方格是否可行 { ? ; sq[qe].x=i; sq[qe].y=j; sq[qe].pre=qh; maze[i][j]=-1; if(sq[qe].x=8 and sq[qe].y=8) { out(); return;} // out ()用来输出找到的路径 } } } print(“No avaliable way.”); } 五、 算法设计题(2题×12分,共24分) 1、输入一个高精度数据s和一个长整数c, 求s×c的精确值。 2、如下图所示的一个数塔,从顶部出发,在每一结点可以选择向左走或是向右 走,一直走到底层,要求找出一条路径,使路径上的数值和最大。 used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional 标准答案 一、填空题(10空×2分,共20分) 1、时间复杂度 空间复杂度 2、渐近时间复杂度或时间复杂度 m3、n 4、递归关系(递归方程) 递归终止(边界)条件 5、无后效性 6、分治算法 7、走不能就掉头 8、搜索到达b结点 或 活结点队列为空 二、 判断题(10题×2分,共20分) 1-5 ? × × ? ? 6-10 × × ? × ? 三、 简答题(3题×6分,共18分) 1、 答:两者都是递归算法思想的应用,根本策略是找出大规模问题与小规模子问题之间的关系,直到小规模的子问题容易得到解决,再由小规模子问题的解逐步导出大问题的解。 分治法能解决问题的特征: 1)问题的规模缩小到一定的程度就可以容易地解决。 2)问题可以分解为若干个规模较小的相似问题,即该问题具有最优子结构性 质。 3)利用该问题分解出的子问题的解可以合并为该问题的解。 4)该问题所分解出的各个子问题是相互独立的且子问题之间不包含公共的子问题。 当问题满足1,2,3,4条时采用分治法,当满足1、2、3条时采用动态规划方法。 2、"递推法"、"递归法"适合解决判定性问题和计算问题。 “贪婪算法”、“分治法” 、“动态规划法” 适合解决最优化问题。 “贪婪算法”、“分治法” 、“搜索算法” 适合解决 构造性问题。 3、回溯法是在包含问题的所有解的解空间树中,按照深度优先的策略,从根结点出发搜索解空间树,当算法搜索至解空间树的任一结点时,总是先判断该结点是否满足问题的约束条件。如果满足进入该子树,继续按深度优先的策略进行搜索。否则,不去搜索以该结点为根的子树,而是逐层向其祖先结点回溯。 四、 程序填空题(6空×3分,共18分) used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional 1 i>=r a[r]=i comb(i-1,r-1) 2 -1 qh<>qe qe=qe+1 五、 算法设计题(2题×12分,共24分) 1、 main( ) { long b,c,d; int a[256],i,j,n;char s1[256]; input(s1,c); n=strlen(s1); d=0; for(i=0,j=n-1;i=0;i--) print(a[i]); } 2、 main( ) { int a[50][50][3],i,j,n; print( 'please input the number of rows:'); input(n); for(i=1;i<=n;i++) for(j=1;j<=i;j++) { input(a[i][j][1]); a[i][j][2]=a[i][j][1]; a[i][j][3]=0; } for(i=n-1;i>=1;i--) for(j=1;j>=i ;j++) if(a[i+1][j][2]>a[i+1][j+1][2]) { a[i][j][2]=a[i][j][2]+a[i+1][j][2]; a[i][j][3]=0; } else { a[i][j][2]=a[i][j][2]+a[i+1][j+1][2]; used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional a[i][j][3]=1; } print(“max=“,a[1][1][2]); j=1; for(i=1;i<=n-1;i++) { print(a[i][j][1],„->?); j=j+a[i][j][3]; } print(a[n][j][1]); } 《算法分析与设计》试题库(八) 一、填空题(每小题3 分,共计30 分) 1. 用O、Ω和θ表示函数f与g之间的关系 ______________________________。 fnnngnn,,loglog ,,,, 1,1n,,2. 算法的时间复杂性为,则算法的时间fn(),,8(3/7),2fnnn,,, 复杂性的阶为__________________________。 3. 快速排序算法的性能取决于______________________________。 4. 算法是___________________________________________________。 5. 在对问题的解空间树进行搜索的方法中,一个活结点最多有一次机会used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional 成为活结点的是_________________________。 6. 在算法的三种情况下的复杂性中,可操作性最好且最有实际价值的是_____情况下的时间复杂性。 7. 大Ω符号用来描述增长率的下限,这个下限的阶越___________,结果就越有价值。。 8. _________________________是问题能用动态规划算法求解的前提。 9. 贪心选择性质是指_______________________________ ____________________________________________________________。 10. 回溯法在问题的解空间树中,按______________策略,从根结点出发搜索解空间树。 二、简答题(每小题10分,共计30分) 1. 试述回溯法的基本思想及用回溯法解题的步骤。 2. 有8个作业{1,2,„,8}要在由2台机器M1和M2组成的流水线上完成加工。每个作业加工的顺序都是先在M1上加工,然后在M2上加工。M1和M2加工作业i所需的时间分别为: M1 10 2 8 12 6 9 4 14 M2 5 7 1 15 16 3 11 13 作业 1 2 3 4 5 6 7 8 给出一个最优调度方案,使得从第一个作业在机器M1上开始加工,到最后一个作业在机器M2上加工完成所需的时间最少,并计算所需的最少时间。 3. 根据优先队列式分支限界法,求下图中从v1点到v9点的单源最短路径,请画出求得最优解的解空间树。要求中间被舍弃的结点用×标记,获得中间解的结点用单圆圈?框起(如v2),最优解用双圆圈◎框起。 ? 12v2v5v8 66233 310v1v36v9441v72 2 10v4v6 三、算法填空(每空2分,共计10分) 设R={r, r, ..., r}是要进行排列的n个元素,其中元素r, r, ..., r可能相12n12n同,试设计一个算法,列出R的所有不同排列,并给出不同排列的总数。算法如下,填写缺失的语句。 used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional template void Swap(Type &a,Type &b){ Type t=b; ________________; //1 a=t; } template bool ok(Type R[],int k,int i){ if(i>k) for(int t=k;t void Perm(Type R[],int k,int n,int &sum){ //n为元素个数,sum记录不 同排列的总数 if(k==n){ ______________________; //3 for(int i=1;i<=n;i++) cout<<___________________; //4 cout<0) { unsigned int i=0; //从串首开始找 while(i1&&n.at(0)=='0') used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional n.erase(0,1); //删除串首可能产生的无用零 return n; } used after the removal of plastic-wrapped, concrete curing period of not less than 7 days. Curing agent emulsion curing agent should be used to avoid yellowing on the surface of the concrete. Detailed rules for the implementation of specific implementation requirements 8 compliance and excellence project 8.1 standard of excellence presided over by the Chief Engineer of the project, implemented in full. 8.2 professional

/
本文档为【5&#46;《算法设计与分析》试题库】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
热门搜索

历史搜索

    清空历史搜索