下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
2009级(2010学年秋季学期《SE211数据结构与算法》期末试题(B卷(考试形式: 考试时间:2小时考试作弊不授予学士学位 123456789111111I、Selection(withonlyoneIndatastructure,whichofthefollowingstructureofdataisnotrelatedtocomputers(与所使storage B)physicalC)logical D)physicalandstorageThecomputeralgorithmrefersto(sortingschedulingFinitesequencesofoperationsforproblemWhenwetalkaboutthedataincomputermemory,()isakindofstructurewhosephysicaladdressandlogicaladdressarethesameandcontiguous(物理地址与逻辑地址相同并且是storagelogicalcontiguousstoragelinkedstorageGivenastackswiththeinputsequence:1,2,...,n,andtheoutputsequence:p1,p2,…,pn,ifp1=n,thenpi=(). Supposethereisatwo-dimensionarraya[1..60,1..70]with60rowsand70columns,whosemainorderisthecolumnorder(以列序为主序).Ifthebaseaddressis10000andeachelementoccupiestwostorageunit,thenthestorageaddressofa[32,58]is().(无第0行第0列元素) D)Noneof LetAbean×nsymmetricmatrix(对称矩阵)Inordertosavememoryitslowertriangularis(下三角)storedinaone-dimensionalarrayB[1..n(n+1)/2]byrow.Thesubscriptposition(下标)kofanyelementaij(i≥j)inlowertriangularis(对下三角部分中任一元素aij(i≥j)在一维数组B的下标位置k值是)() C)i(i+1)/2+j-1GiventwostringsAandB,theoperationtosearchthefirstpositionofBinAiscalled( B)patternmatchingC)substring D)stringlengthThepost-orderandthein-ordersequencesofabinarytreearedabecanddebac.Thepreorderis(). Useanadjacencytable(邻接表)torepresentandirectedgraphincludingnverticesandedges,thetimecomplexityofdeletingalledgesassociatedwithavertexis( Howmanyminimumspanningtreesdoesanundirectedgraphhas?(morethanoneoronlymaybenotDeterminingwhetherthereisaloopinadirectedgraph,wecanusetopologysortingaswellas()searchingmethodforthecriticalpath(求关键路径方法breadth-firsttraversaldepth-firsttraversalUsingthebreadth-firstalgorithmtotraversethegraphrepresentedbyanadjacencytable,weshouldusethedatastructurenamed()toimplementit. Usingthedepth-firstalgorithmtotraversethegraphrepresentedbyanadjacencytable,weshouldusethedatastructurenamed()toimplementit. Ifthereexistsamappingrelationshipbetweenthememoryaddressofanodeandthekeyword(结点的存储地址与其关键字之间存在某种映射关系),wecalledthestorage第3页/第3页/5scatter(Hash)storagelinkedstorageindexstorage Whichkindofsortingalgorithmweused?(Selection B)shell C)merge D)quick BlankThetimecomplexity “i=1;while(i<=n) Thetimecomplexityofaccessanynodeinthecontiguouslist(顺序表)is ,sowecalledthecontiguouslistthe datastructure.Ifthereexistacompletebinarytree(完全二叉树)including768nodes,thenthenumberoftheleafnodeis Ifthereexistak-waytree(K叉树)includingnnodes,themaximumpossibledepth ,theminimumdepthis arebothcommonlyusedstoragestructureforgraphs.Totraverseagraph,weusuallyusethefollowingtwomethods: Inordertomergetwoorderedsequenceswithlengthmintoaneworderedsequence,weneedatleast timesofkeycomparing,andatmost timesofkeycomparing.SupposeadirectedgraphGincludingasetofvertex{v1,v2,v3,v4,v5},andasetof{<v1,v2>,<v2,v4>,<v3,v5>,<v1,v3>,<v1,v5>,<v2,v3>,<v3,v4>,<v4,v5>},thenodewhichhasthegreatestin-degree(入度)is .Thenodewhichhasthegreatestout-degree(出度)is,theresultoftopologicalsortingofGis QuestionsandAnswersGivenanemptybinarytree,pleaseinserte,b,d,f,a,g,cinsequence,bytheerconstructingabinarysearchtree.(9%)AssumingthemessageusedforcommunicationiscomposedofonlyC1~C8letters(用于通C1~C8字母组成)thefrequencyofeachletterappearinginthemessageis0.07,0.19,0.02,0.06,0.32,0.03,0.21,0.10.DesigntheHuffmancodingforthese8letters,andrepresentitwithanotherequallengthbinaryencodingmethodfrom0to7(试80~7的二进制等长编码方案表示).Inthisexample,comparetheadvantagesanddisadvantagesofthesetwomethods.(9%)GivenagraphG,seefigure1.TrytofindouttheMinimumspanningtree(最小生成树),anddrawthelogicalstructuralgraph(逻辑结构图).ShowtheStorageforgraphG,withtwodifferentrepresentations(hint:useadjacencymatrixandadjacencytable).Inthefollowingsequenceofkeys,insertthekeys,intheordershown,tobuildthemintoanAVLtree.Pleasedrawtheillustrationfiguresforthewholeprocedure.(9%) Reverse(逆转List:DesignanalgorithmtoreservealistLYouaregivenTheheadofL:Linklist*Thedeclarationoflist-node:template<classEntry>structLinklist{Entrydata;Linklist*next;Declarationofprotofunction:voidreverse(LinklistNode:DonotcreatenewnodeforthereversedlistwhenHint:TheillustrationfiguresforthewholeprocedureisasWriteafunctionvoidselectionSort(intA[],intn)toimplementaselectionsortalgorithm.ThearrayA[]containstheintegerstosort,andndenotesthesizeofA[] Writeanon-recursive(非递归)algorithmtotraverseabinarytreebypre-order(前序)Thedeclarationofbinarytreeandtreenodearegivenasfollowing:template<classclass{
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 学习点数和分类(教学设计)-2023-2024学年小学生科学课后服务拓展
- 小学作文专题第12讲(习题)看图类作文教学设计-2023-2024学年语文六年级下册统编版
- 6 人大代表为人民 第三课时 教学设计-2024-2025学年道德与法治六年级上册统编版
- 人教版初中美术九年级上册 第二单元 第1课 剪纸 教案
- 学习如何做运动记录-体育教学设计
- 吉林省通化市八年级体育与健康下册 技巧(1)教案
- 2024-2025学年积极应对压力的心理教育教学设计
- 25慢性子裁缝和急性子顾客教学设计-2023-2024学年统编版语文三年级下册
- Unit 5 In the Park Lesson 2(教学设计)-2024-2025学年人教新起点版英语二年级上册
- 《乙酸》教学设计 化学
- 汽车总体设计
- 全册教案(教案)-一年级上册数学北师大版
- 幼儿园财产登记表
- 2024年浙江机电职业技术学院单招职业技能测试题库附答案
- 奥鹏-中国医科大学2024年7月《药物分析》(答案)作业考核试题
- 【项目方案】源网荷储一体化绿色供电园区项目规划报告
- 2024年北京市第一次普通高中学业水平合格性考试物理试题(含答案解析)
- 医学检验试题库(Medical eamination questions bank)
- 宣传片基本报价单三篇
- DB32T4004-2021水质 17种全氟化合物的测定 高效液相色谱串联质谱法
- 2024年广东河源市消防救援支队政府专职消防员招聘笔试参考题库附带答案详解
评论
0/150
提交评论