




已阅读5页,还剩1页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
课程名称: 任课教师: 学号: 姓名:四川大学期末考试试题(闭卷)(20092010学年第1学期)课程号: 311036030课程名称: 数据结构与算法分析(A卷)任课教师: 孙界平,张卫华 适用专业年级: 软件工程 2008级学号: 姓名: 考试须知四川大学学生参加由学校组织或由学校承办的各级各类考试,必须严格执行四川大学考试工作管理办法和四川大学考场规则。有考试违纪作弊行为的,一律按照四川大学学生考试违纪作弊处罚条例进行处理。四川大学各级各类考试的监考人员,必须严格执行四川大学考试工作管理办法、四川大学考场规则和四川大学监考人员职责。有违反学校有关规定的,严格按照四川大学教学事故认定及处理办法进行处理。题 号一(40%)二(8%)三(42%)四(10%)卷面成绩得 分阅卷时间注意事项:1. 请务必将本人所在学院、姓名、学号、任课教师姓名等信息准确填写在试题纸和添卷纸上;2. 请将答案全部填写在本试题纸上;3. 考试结束,请将试题纸、添卷纸和草稿纸一并交给监考老师。eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee评阅教师得分一、单项选择题(本大题共20小题,每小题2分,共40分)提示:在每小题列出的备选项中只有一个是符合题目要求的,请将其代码写到答题纸上。错选、多选或未选均无分。1. An algorithm must be or do all of the following EXCEPT: a) correctb) composed of concrete steps*c) ambiguousd) composed of a finite number of stepse) terminate2. For set P, the notation |P| indicates*a) The number of elements in P.b) The inverse of P.c) The powerset of P.d) None of the above.3. Pick the growth rate that corresponds to the most efficient algorithm when n = 4.a) 5nb) 20 log nc) 2n2*d) 2n4. When the upper and lower bounds for an algorithm are the same, we use:a) big-Oh notation.b) big-Omega notation.*c) Theta notation.d) asymptotic analysis.e) Average case analysis.f) Worst case analysis.5. As compared to the linked list implementation for lists, the array-based list implementation requires:a) More spaceb) Less space*c) More or less space depending on how many elements are in the list.6. When comparing the doubly and singly linked list implementations, we find that the doubly linked list implementation*a) Saves time on some operations at the expense of additional space.b) Saves neither time nor space, but is easier to implement.c) Saves neither time nor space, and is also harder to implement.7. The correct traversal to use on a BST to visit the nodes in sorted order is:a) Preorder traversal.*b) Inorder traversal.c) Postorder traversal.8. When every node of a full binary tree stores a 4-byte data field, two 4-byte child pointers, and a 4-byte parent pointer, the overhead fraction is approximately:a) one quarter.b) one third.c) one half.d) two thirds.*e) three quarters.f) none of the above.9. If a node is at position r in the array implementation for a complete binary tree, then its right child is at:a) (r - 1)/2 if r 0b) 2r + 1 if (2r + 1) n*c) 2r + 2 if (2r + 2) nd) r - 1 if r is evene) r + 1 if r is odd.10. The Huffman coding tree works best when the frequencies for letters area) Roughly the same for all letters.*b) Skewed so that there is a great difference in relative frequencies for various letters.11. A topological sort requires all of the following except:a) The graph be directed.b) The graph contain no cycles.*c) The graph contain weights on the edges.12. When sorting n records, Mergesort has worst-case cost:a) O(log n).b) O(n).*c) O(n log n).d) O(n2)e) O(n!)f) None of the above.13. As compared to the time required to access one unit of data from main memory, accessing one unit of data from disk is:a) 10 times faster.b) 1000 times faster.c) 1,000,000 time faster.d) 10 times slower.e) 1000 times slower.*f) 1,000,000 times slower.14. The basic unit of I/O when accessing a disk drive is:a) A byte.*b) A sector.c) A cluster.d) A track.e) An extent.15. The most time-consuming part of a random access to disk is usually:*a) The seek.b) The rotational delay.c) The time for the data to move under the I/O head.16. Which is generally more expensive?a) A successful search.*b) An unsuccessful search.17. The 80/20 rule indicates that:a) 80% of searches in typical databases are successful and 20% are not.*b) 80% of the searches in typical databases are to 20% of the records.c) 80% of records in typical databases are of value, 20% are not.18. Hashing is most appropriate for:a) In-memory applications.b) Disk-based applications.*c) Either in-memory or disk-based applications.19. The primary key is:*a) A unique identifier for a record.b) The main search key used by users of the database.c) The first key in the index.20. Depth-first search is best implemented using:*a) A stack or recursion.b) A queue.c) A tree.评阅教师得分二、判断题(本大题共8小题,每小题1分,共8分)提示:正确答T,错误答F,将其结果写到答题纸上。T 1. There is TWO queues needed to implement the priority queue. One queue is used for actual storing of data and another for storing priorities.T 2. A binary tree is a tree in which each node have 2 child except leaf node.F 3. When sorting n records, Quicksort has worst-case cost O(n log n).T 4. Depth-first search is best implemented using stack or recursion.T 5. We say two vertices are connected if there is a path connect them.F 6. Consider a node in an AVL tree, the height of left sub-tree minus height of right sub-tree can only be -1 or 1.T 7. Build a hash table of set 23,44,36,48,52,73,64,58, h(K)=K%13, then the address of element 64 is 12F 8. The Huffman coding tree works best when the frequencies for letters are roughly the same for all letters.评阅教师得分三、问答题(本大题共6小题,每小题7分,共42分)。1. Determine (in a Big-O sense) the order of the following method as a function of the parameter n. A)x=0;for(i=1;in;i+)for(j=1;j=n-i;j+) x+;B)int i,j,k;for(i=0;in;i+)for(j=0;j=n;j+) cij=0;for(k=0;kn;k+)cij=aik*bkjA) O(n2) B) O(n3) 2. Suppose a binary-tree, the pre-order sequence of this binary-tree is EBADCFHGIKJ, and the in-order sequence of it is ABCDEFGHIJK, please write down the post-order sequence of this binary-tree.ACDBGJKIHFE3. Build the Huffman coding tree for the following set of weights (5,9,11,2,7,16)答案50 92030111614 7 7 2 54. Draw AVL of the following sequence16, 3, 7, 11, 9, 26, 18, 14, 15答案:5. Write down the DFS and BFS sequence of graph below: (Attention: while traversing, choose vertex from numeric sequence when more than one vertex can be ch
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 听写单词考试题及答案
- 叉车分类考试题及答案
- 贝壳vr讲房专家考试试题及答案
- 线路电力测试题及答案
- 网络模型面试题及答案
- 科举考试试题及答案
- 节能减排考试试题及答案
- 针灸体位考试题及答案
- 管线保护方案
- 律师辩护专业知识培训课件
- 临床护理带教新思路
- 韦莱韬悦-东方明珠新媒体职位职级体系咨询项目建议书-2017
- 中国心力衰竭诊断和治疗指南2024解读(完整版)
- 八上外研版英语书单词表
- 高标准农田建设项目施工合同
- 腹内高压综合征
- 识别界限 拒绝性骚扰 课件 2024-2025学年人教版(2024)初中体育与健康七年级全一册
- 2024年秋季新人教版八年级上册物理全册教案(2024年新教材)
- 污水处理托管服务 投标方案(技术方案)
- 压疮护理质量改进一等奖(有稿)
- 深基坑施工验收要求
评论
0/150
提交评论