数据结构与算法分析 复习试卷A2
更新时间:2023-09-14 14:06:01 阅读量: 初中教育 文档下载
四川大学期末考试试题(闭卷)
(2009~2010学年第1学期)
课程号: 311036030课程名称: 数据结构与算法分析(A卷) 任课教师: 孙界平,张卫华 适用专业年级: 软件工程 2008级 学号: 姓名:
考试须知 四川大学学生参加由学校组织或由学校承办的各级各类考试,必须严格执行《四川大学考试工作管理办法》和《四川大学考场规则》。有考试违纪作弊行为的,一律按照《四川大学学生考试违纪作弊处罚条例》进行处理。 四川大学各级各类考试的监考人员,必须严格执行《四川大学考试工作管理办法》、《四川大学考场规则》和《四川大学监考人员职责》。有违反学校有关规定的,严格按照《四川大学教学事故认定及处理办法》进行处理。 题 号 一(40%) 得 分 阅卷时间 二(8%) 三(42%) 四(10%) 卷面成绩 注意事项:1. 请务必将本人所在学院、姓名、学号、任课教师姓名等信息准确填写在试题纸和添卷纸上;
2. 请将答案全部填写在本试题纸上;
3. 考试结束,请将试题纸、添卷纸和草稿纸一并交给监考老师。
???????????????????????????????????????????????
评阅教师
得分
一、单项选择题(本大题共20小题,每小题2分,共40分)提示:在每小题列
出的备选项中只有一个是符合题目要求的,请将其代码写到答题纸上。错选、多选或未选均无分。
1. A solution is efficient if
a) it solves a problem within the require resource constraints. b) it solves a problem within human reaction time.
c) it solves a problem faster than other known solutions. d) a and b. *e) a and c. f) b and c.
2. If R is a binary relation over set S, then R is transitive if
a) aRa for all a in S.
b) whenever aRb, then bRa, for all a, b in S.
c) whenever aRb and bRa, then a = b, for all a, b in S. *d) whenever aRb and aRc, then aRc, for all a, b, c in S.
3. When performing asymptotic analysis, we can ignore constants and low order terms because:
*a) We are measuring the growth rate as the input size gets large. b) We are only interested in small input sizes. c) We are studying the worst case behavior. d) We only need an approximation.
4. For a list of length n, the linked-list implementation's prev function requires worst-case time:
a) O(1).
注:字迹务必清晰,书写工整。
出题:
编辑:
系所审核:
学院审核:
本题共7页,本页为第1页 教务处试题编号:
课程名称: 任课教师: 学号: 姓名:
b) O(log n). *c) O(n). d) O(n^2).
5. Finding the element in an array-based list with a given key value requires worst case time:
a) O(1). b) O(log n). *c) O(n). d) O(n^2).
6. All operations on a stack can be implemented in constant time except:
a) Push b) Pop
c) The implementor's choice of push or pop (they cannot both be implemented in constant time). *d) None of the above.
7. The Full Binary Tree Theorem states that:
*a) The number of leaves in a non-empty full binary tree is one more than the number of internal nodes. b) The number of leaves in a non-empty full binary tree is one less than the number of internal nodes. c) The number of leaves in a non-empty full binary tree is one half of the number of internal nodes. d) The number of internal nodes in a non-empty full binary tree is one half of the number of leaves.
8. When every node of a full binary tree stores an 8-byte data field and two 4-byte child pointers, 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. When sorting n records, Insertion sort has worst-case cost:
a) O(log n). b) O(n).
c) O(n log n). *d) O(n^2) e) O(n!)
f) None of the above.
10. Shellsort takes advantage of the best-case behavior of which sort?
*a) Insertion sort b) Bubble sort c) Selection sort d) Shellsort e) Quicksort f) Radix sort
11. The most effective way to reduce the time required by a disk-based program is to:
a) Improve the basic operations.
*b) Minimize the number of disk accesses.
注:字迹务必清晰,书写工整。
本题共7页,本页为第2页 教务处试题编号:
课程名称: 任课教师: 学号: 姓名:
c) Eliminate the recursive calls. d) Reduce main memory use.
12. 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.
13. In external sorting, a run is:
*a) A sorted sub-section for a list of records. b) One pass through a file being sorted. c) The external sorting process itself.
14. Which is generally more expensive?
a) A successful search. *b) An unsuccessful search.
15. Which of the following is often implemented using a self-organizing list?
*a) Buffer pool. b) Linked list. c) Priority queue.
16. In hashing, the operation that will likely require more record accesses is:
*a) insert b) delete
17. Linear indexing is good for all EXCEPT:
a) Range queries.
b) Exact match queries. *c) Insertion/Deletion.
d) In-memory applications. e) Disk-based applications.
18. Tree indexing methods are meant to overcome what deficiency in in-memory data structures such as the BST?
a) Inability to handle range queries. b) Inability to handle updates.
*c) Inability to handle large data sets.
19. Breadth-first search is best implemented using:
a) A stack or recursion. *b) A queue. c) A tree.
20. The single-source shortest path problem can be used to:
a) Sort all of the graph vertices by value.
b) Sort all of the graph vertices so that each vertex is listed prior to any others that depend on it. *c) Sort all of the graph vertices by distance from the source vertex.
注:字迹务必清晰,书写工整。
本题共7页,本页为第3页 教务处试题编号:
课程名称: 任课教师: 学号: 姓名:
评阅教师
得分
二、判断题(本大题共8小题,每小题1分,共8分)提示:正确答T,错误答F,
将其结果写到答题纸上。
F 1. Queue is the data structures used to perform recursion.
T 2. A binary tree is a tree in which each node have 2 child except leaf node. T 3. Depth-first search is best implemented using stack or recursion. F 4. A topological sort requires The graph contain cycles.
T 5. We say two vertices are adjacent only when there is an edge 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, then the address of element 64 is 12 F 8. The C++ programmer's view of a disk file is most like a graph.
评阅教师
得分
三、问答题(本大题共6小题,每小题7分,共42分)。
1. Determine (in a \
A) i=n-1;
while((i>=0)&&A[i]!=k))
j--; return (i); B) fact(n) {
if(n<=1)
return (1); else return (n*fact(n-1)); }
A) O(n) B) O(n)
2. Write down the pre-root and post-root traversal of the forest below, and draw the binary-tree of this forest.
A B
D C E
F
G H
I J
K L M N
O 注:字迹务必清晰,书写工整。
本题共7页,本页为第4页 教务处试题编号:
课程名称: 任课教师: 学号: 姓名:
先根遍历:ABCDEFGHIJKLMNO 后根遍历:BDEFCAHJIGKNOML 二叉树:
A B C H D E F J I M N O
G K L
3. Draw AVL of the following sequence
16, 3, 7, 11, 9, 26, 18, 14, 15
答案:
4. 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 chosen)
0 3 6 1 4 7
2 5 8
深度优先搜索序列:0,4,7,5,8,3,6,1,2 广度优先搜索序列:0,4,3,1,7,5,6,2,8
5. List the order in which the edges of the following graph are visited when running Prim's MST algorithm. Show the final MST.
注:字迹务必清晰,书写工整。
本题共7页,本页为第5页 教务处试题编号:
正在阅读:
数据结构与算法分析 复习试卷A209-14
路灯工程施工方案05-08
观看电影《忠诚与背叛》个人心得体会范文03-24
说文解字第一篇上(1)07-07
银行间债券市场简介及发行承销上市流程12-29
个人理财实训题答案10-04
道德的主要根基是感性体悟/理性思考01-27
社区卫生服务站工作总结04-15
快乐的劳动作文800字06-26
- 二甲基甲酰胺安全技术说明书
- 南邮计算机网络复习题
- 高分子物理实验指导书 - 图文
- 2009.9.25 莞惠环控专业施工图设计技术要求
- 学生工作简报
- 揭阳市斯瑞尔环境科技有限公司废酸综合利用项目可行性研究报告-广州中撰咨询
- 今日靓汤(佘自强)
- 奥数 - 二年级 - 数学 - 第三讲时间的教师版计算答案 - 图文
- 如何命制一份好的物理试卷
- 数据库开题报告
- 禁用未经批准或已经废止或淘汰技术的制度流程
- 大学英语(二)第2阶段测试题
- 湘教版一年级上册美术教案(全)
- (整套)学生顶岗(毕业)实习手册
- 高频 二极管包络检波 - 图文
- 2018届中考英语复习题型四任务型完形填空备考精编含解析 - 186
- 郑煤集团超化煤矿一采区开采设计 - 图文
- 财政学习题
- 摄影摄像复习资料
- SMC D-A93接线方式 - 图文
- 数据结构
- 算法
- 试卷
- 复习
- 分析
- 2014年初中海淀区语文一模(含答案+解析)
- 2014年度高校“青蓝工程”优秀青年骨干教师培养对象名单
- (麦山版)数字逻辑与数字系统实验指导书
- 上虞市第八次少代会应急处置预案
- 一年级数学下册教学计划
- 广东省深圳高中联考联盟2018-2019学年第一学期期末考试试题高二文科数学(解析版)
- 停办(关闭)矿山残留矿产资源储量登记书填表说明
- 《中国当代文学》复习资料
- 外贸函电课程教学大纲
- 教师假期校本培训心得 金晓磊
- 一个12bit - 800MSPS电流舵结构的高速DAC的设计 - 20120507
- 浅谈阅读教学中的比较阅读法
- 大工15春《SQL数据库课程设计》模板及要求答案在最后
- 经济师《中级工商管理专业知识与实务》笔记(2)
- 2010海南省驾校考试科目一理论考试试题及答案
- 十二种炖品让女人气血两旺女孩都看看 - 图文
- 温岭市滨海镇
- 2018-2024年中国花洒市场运营状况分析及投资前景价值评估报告(目录) - 图文
- 2018年人教版小学数学五年级数学全册精品教案 - 图文
- 交通违法动态信息处理和统计分析制度 A