




已阅读5页,还剩2页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
200X年试题选择题(1)Suppose 1,2,3,4 is the order which these elements push onto a stack. The sequence obtained is ()A.4.1.2.3 B.3.2.4.1 C.3.4.1.2 D.4.3.1.2(2)Suppose that a linear list contains n=31 nodes, the binary search is applied to the list, the maximum times in searching is ()A 4 B 5 C 25-1 D 24-1(3)In the following sorting algorithms, which is unstable()A Selection sort B Merge sort C Bubble sort D Insertion sort(4)Bubble sort is used for n nodes, the minimum number of comparisons is () A n-1 B n C n(n-1/2) D n(n+1)/2(5)How many binary trees in different forms can at most be built by three nodes?A 4 B 5 C 6 D 7填空题.(1)The stack takes on character of _(2)The postfix expression is abcdef*/-*+. Its infix expression is _(3)The advantage of circular queues is _.(4)If the depth of full binary tree is k, then the number of nodes in the tree at least_(5)The selection sort is used to sort n nodes, the number of its comparisons is _三(1) Write a function Deletion in C for linear list. (5 points)(2)Write a function Pop in C for linked stack. (5 points)(3)Write a function in C for binary search. (10 point )(4)Write some sentences in C which delete the node b in the following figure. (5 point)(附图)ABCP(5)Write some sentences in C which insert the node b in the following figure(5pont)(附图)ACPB四(1) Write a function in C of randex(基数)sort. (10 point )(2)Write a function in C of quick sort. (10 point )(3)Suppose that a hash table contains 5 entries indexed from 0 through 4 and that the following keys are to be mapped into the table. 12,19,17,14,10,24,15Hash function h(k)=k mod 5.(a)Determine the hash addresses and resolute collision by chaining. (b)Write a function in C for search by chaining. (10point)五.(1)Write a function in C which will inter change all left and right subtrees in binary tree. (10 point)(2)Write a function in C for linked queue.(10 point)200X年试题选择题(1) In a simple linked list with n nodes, the number of pointer fields with NULL Totals(). A. n B.2 C.n/2 D.1(2)In the linear lists, two concepts which are the same as each other is()A node B. record C. field D. type of structure(3)In the binary search tree, for any root of subtree, the keys of all nodes in its left subtree is () the keys of all nodes in its right subtree.A less than B equal to C great than D less than or equal to (4)For general trees, the correct choice is ()A it may be empty B at least one nodeC at least two nodes D A.B and C are incorrect(5)The bubble sort is used to n nodes, least number of comparison is()A n-1 B n C n(n-1)/2 D n(n+1)/2填空题(1)A binary tree with n nodes storaged by standard form, there are _ pointers where _pointers are used to point to sub-nodes, and _ pointers are empty.(2)The postfix expression is abc*+de/f*-, then its infix expression is _(3)The basic operations of linear lists are_(4)The character of stack is_(5)Hash storage faced with two problems of _ and _三(1)Write a function Pop for stack (5point )(2) Translate the quadratic formula. (a+b*c)d(e*f/g)-h*iinto postfix form. (10point)(3) Write a function in C which changes the linked list in Figure 1 to another linked list in Figure 2.(10point)(附图)A0A2An-1. Fig.1A1A0.An-1 Fig.2(4)(1).(a)By hand, trace through the steps bubble sort will use on the list. The following seven number to be sorted into increasing order.(b)Write a function of bubble sort. (10point)(2)By hand, sort the list 46.26.22.68.48.42.36.84.66 using selection sort.Write a function of selection sort.(10point)(3).Suppose that a hash table contains 11 entries from 0 through 10 and that the following keys are to be mapped into the table.(32,75,63,48,94,25,36,18,70)Hash function h(k)=k mod 11(a)Determine the hash addresses and resolute collision by linear probing.(b)Determine the hash addresses and resolute collision by chaining. (10point )(4) For each of the following binary trees, determine the order in which the nodes will be visited mixed order given by invoking function A(5point)Void A(TreeNode *root, void(*Visit)(TreeEntry x) ) If(root) Visit(root-entry) B(root-left, Visit); B(root-right, Visit); void B(TreeNode *root, void(*Visit)(TreeEbtry x) If(root) A(root-left, Visit); Visit(root-entry); A(root-right, Visit); 五.(1)Write
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 离婚谈判策略全解专业指导助你成功离婚
- 物流企业驾驶员劳动合同及交通法规遵守协议
- 离婚协议书起草及离婚程序实务操作合同
- 离婚协议签署后反悔情形下个人隐私保护合同
- 针对国际海上运输的船舶建造合同中的质量与进度要求
- 养老金私募投资风险管理策略-洞察及研究
- 个性化营养干预研究-洞察及研究
- 教师招聘之《幼儿教师招聘》能力提升试题打印及答案详解【易错题】
- 智能电网中的能源调度技术-洞察及研究
- 小学科学竞赛试题及答案
- 【MOOC】医学心理学-北京大学 中国大学慕课MOOC答案
- 大型活动火灾应急预案
- 剪映专业版教学课件
- 地坪拆除服务合同
- DB22T 277-2011 建筑电气防火检验规程
- 广东省执法证网上考试系统题库及答案
- 《建筑设计基础》全套教学课件
- 统编2024版七年级语文上册全册知识点梳理
- 2024年新青岛版(六三制)六上科学全册知识点
- 山东省潍坊市寒亭区2023-2024学年七年级上学期9月入学测试数学试卷(含答案)
- 三轴搅拌桩安全技术交底(好)
评论
0/150
提交评论