算法分析算法复习题

上传人:人*** 文档编号:487415870 上传时间:2024-02-12 格式:DOCX 页数:13 大小:552.04KB
返回 下载 相关 举报
算法分析算法复习题_第1页
第1页 / 共13页
算法分析算法复习题_第2页
第2页 / 共13页
算法分析算法复习题_第3页
第3页 / 共13页
算法分析算法复习题_第4页
第4页 / 共13页
算法分析算法复习题_第5页
第5页 / 共13页
点击查看更多>>
资源描述

《算法分析算法复习题》由会员分享,可在线阅读,更多相关《算法分析算法复习题(13页珍藏版)》请在金锄头文库上搜索。

1、细心整理有翻译1. The O-notation provides an asymptotic upper bound. The W-notation provides an asymptotic lower bound. The -notation asymptotically a function form above and below. O型符号供应一个渐近的上限。符号供应一个渐近下界。-符号渐近函数形式的上方和下方。2. To represent a heap as an array,the root of tree is A1, and given the index i of a

2、 node, the indices of its parent Parent(i) return i/2; ,left child, Left(i) return 2*i; ,right child, right(i) return 2*i + 1; .代表一个堆中的一个数组,树的根节点是A1,并且给出一个节点i,那么该节点的父节点是 左孩子 右孩子 3. Because the heap of n elements is a binary tree, the height of any node is at most Q(lg n).因为n个元素的堆是一个二叉树,随意节点的树高最多是 4.

3、 In optimization problems , there can be many possible solutions. Each solution has a value, and we wish to find a solution with the optimal (minimum or maximum) value. We call such a solution an optimal solution to the problem.在 最优化问题 中,有很多可能的解,每个解都有一个值,我们盼望找到一个最优解最大或最小,我们称这个解为最优解问题。5. optimal subs

4、tructure if an optimal solution to the problem contains within it optimal solutions to subproblems. 最优子构造 中问题的最优解,至少包含它的最优解的子问题。6. A subsequence of X if there exists a strictly increasing sequence of indices of X such that for all j = 1, 2, ., k, we have xij = zj .Let X = and Y = be sequences, and l

5、et Z = be any LCS of X and Y.(1). If xm = yn, then zk = xm = yn and Zk-1 is an LCS of Xm-1 and Yn-1.(2). If xm yn, then zk xm implies that Z is an LCS of Xm-1 and Y.(3). If xm yn, then zk yn implies that Z is an LCS of X and Yn-1.7. A greedy algorithm always makes the choice that looks best at the m

6、oment. That is, it makes a locally optimal choice in the hope that this choice will lead to a globally optimal solution.贪心算法 常常须要在某个时刻找寻最好的选择。正因如此,它在当下找到盼望中的最优选择,以便引导出一个全局的最优解。8. The greedy-choice property and optimal sub-structure are the two key ingredients of greedy algorithm.贪心选择 和最优子构造是贪心算法的两个重

7、要组成局部。9. When a recursive algorithm revisits the same problem over and over again, we say that the optimization problem has overlapping subproblems.当一个递归算法一遍一遍的遍历同一个问题时,我们说这个最优化问题是 重叠子问题。10. greedy-choice property is a globally optimal solution can be arrived at by making a locally optimal (greedy)

8、choice. 贪心选择性质 是一个全局的最优解,这个最优解可以做一个全局的最优选择。11. An approach of Matrix multiplication can develope a (V4)-time algorithm for the all-pairs shortest-paths problem and then improve its running time to (V3 lg V). 一个矩阵相乘问题的解决可以一个 时间困难度算法的全部路径的最短路径问题,改良后的时间困难度是 。12. Floyd-Warshall algorithm, runs in (V3) t

9、ime to solve the all-pairs shortest-paths problem.FW算法在 时间困难度下可以解决最短路径问题。13. The running time of Quick Sort is O(n2) in the worst case, and O(n lg n) in the average case.快速排序的平均时间困难度是 O(n lg n) ,最坏时间困难度是 O(n2) 。14. The MERGE(A,p,q,r) procedure in merge sort takes time (n). MERGE在归并排序中所花费的时间是 。15. Gi

10、ven a weighted, directed graph G = (V, E) with source s and weight function w : E R, the Bellman-Ford algorithm makes |V| - 1 passes over the edges of the graph.给一个带权重的有向图G = (V, E),权重关系w : E R,那么the Bellman-Ford算法需经过 条边。16. The Bellman-Ford algorithm runs in time O(V E).Bellman ford 算法的时间困难度是 。17.

11、A decision tree represents the comparisons made by a comparison sort.The asymptotic height of any decision tree for sorting n elements is W(n lg n).一个决策树代表一个比拟类型,通过比拟排序。N个元素的随意决策树的渐进高度是 。True-false questions 1. An algorithm is said to be correct if, for some input instance, it halts with the correct

12、 output F假如给一个算法输入一些实例,并且它给力正确的输出,那么相识这个算法是正确的。2. Insertion sort always best merge sort F插入排序总是优越与归并排序。3. (n lg n) grows more slowly than (n2). Therefore, merge sort asymptotically beats insertion sort in the worst case. T(n lg n)4. Currently computers are fast and computer memory is very cheap, we

13、have no reason to study algorithms. F5. In RAM (Random-Access Machine) model, instructions are executed with concurrent operations. F6. The running time of an algorithm on a particular input is the number of primitive operations or “steps” executed. T7. Quick sorts, have no combining step: two subar

14、rays form an already-sorted array. T8. The running time of Counting sort is O(n + k). But the running time of sorting is W(n lg n). So this is contradiction. F9. The Counting sort is stable. T10. In the selection problem, there is a algorithm of theoretical interest only with O(n) worst-case running

15、 time. T11. Divide-and-conquer algorithms partition the problem into independent subproblems, solve the subproblems recursively, and then combine their solutions to solve the original problem. In contrast, dynamic programming is applicable when the subproblems are not independent, that is, when subproblems share subsubproblems. T12. In dynamic programming, we build an optimal solution to the problem from optimal solutions to subproblems. T13.

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > 工作计划

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号