![2016华南理工大学数据结构试卷A及答案_第1页](http://file4.renrendoc.com/view/26dfa9e36019727aa5e64b1a1747c3ce/26dfa9e36019727aa5e64b1a1747c3ce1.gif)
![2016华南理工大学数据结构试卷A及答案_第2页](http://file4.renrendoc.com/view/26dfa9e36019727aa5e64b1a1747c3ce/26dfa9e36019727aa5e64b1a1747c3ce2.gif)
![2016华南理工大学数据结构试卷A及答案_第3页](http://file4.renrendoc.com/view/26dfa9e36019727aa5e64b1a1747c3ce/26dfa9e36019727aa5e64b1a1747c3ce3.gif)
![2016华南理工大学数据结构试卷A及答案_第4页](http://file4.renrendoc.com/view/26dfa9e36019727aa5e64b1a1747c3ce/26dfa9e36019727aa5e64b1a1747c3ce4.gif)
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
«Da«DataStructure?A试卷题号一二三四五六七八九十一总分得分评卷人考前须知:1.考前请将密封线内填写清楚;2.所有答案请直接答在试卷上;3.测试形式:闭卷;4.本试卷共十大题,总分值100分,测试时间120分钟.1.Selectthecorrectchoice.(20scores,each2scores)诚信应考,测试作弊将带来严重后果!华南理工大学期末测试⑴AnalgorithmmustbeordoallofthefollowingEXCEPT:(B)(A)Partiallycorrect(B)Ambiguous(C)terminate(D)ConcretestepsPickthegrowthratethatcorrespondstothemostefficientgrowingalgorithmasngetslarger:(B)(A)4n3(B)5n2logn(C)3n!(D)2nIfadataelementrequires12bytesandapointerrequires4bytes,thenalinkedlistrepresentationwillbemorespaceefficientthanastandardarrayrepresentationwhenthefractionofnon-nullelementsislessthanabout:(B)(A)1/3(B)3/4(C)3/5(D)2/3Whichistherealizationofadatatypeasasoftwarecomponent:(A)(A)Anabstractdatatype(B)Arealdatatype(C)Atype(D)AdatastructureThemosteffectivewaytoreducethetimerequiredbyadisk-basedprogramisto:(B)(A)ImprovethebasicI/Ooperations.(B)Minimizethenumberofdiskaccesses.(C)Eliminatetherecursivecalls.(D)Reducemainmemoryuse.Inthehashfunction,collisionrefersto(B).Twoelementshavethesamekeyvalue.Differentkeysaremappedtothesamepositionofhashtable.Tworecordshavethesamerequiringnumber.Dataelementsaretoomuch.GivenanarrayasA[m][n].SupposedthatA[0][0]islocatedat644(io)andA[4][4]isstoredat676i.).(彳0)“meansthatthenumberispresentedindecimals.ThentheelementA[2][2](io)isatposition:(B)(A)692(B)660(C)650(D)708Whichstatementisnotcorrectamongthefollowingfour:(A)Thenumberofemptysub-treesinanon-emptybinarytreeisonelessthanthenumberofnodesinthetree.TheMergesortisastablesortingalgorithm.Therootofabinarytreetransferredfromageneraltreehasonlyleftchild.Asectoristhesmallestunitofallocationforarecord,soallrecordsoccupyamultipleofthesectorsize.(9)Treeindexingmethodsaremeanttoovercomewhatdeficiencyinhashing?(D)(A)Inabilitytohandlerangequeries.(B)Inabilitytomaximumqueries(C)Inabilitytohandlequeriesinkeyorder(D)Allofabove.(10)Assumethatwehaveeightrecords,withkeyvaluesAtoH,andthattheyareinitiallyplacedinalphabeticalorder.Now,considertheresultofapplyingthefollowingaccesspattern:FDFGEGFADFGEifthelistisorganizedbythetransposeheuristic,thenthefinallistwillbe(B).(A)AFCDHGEB(B)ABFDGECH(C)ABFGDCEH(D)AHFDGECBFilltheblankwithcorrectC++codes:(16scores)Givenanarraystoringintegersorderedbyvalue,modifythebinarysearchroutinestoreturnthepositionofthefirstintegerwiththeleastvaluegreaterthanKwhenKitselfdoesnotappearinthearray.ReturnERRORifthegreatestvalueinthearrayislessthanK:(10scores)//Returnpositionoflestelement>=Kintnewbinary(intarray[],intn,intK){intl=-1;intr=n;//landrbeyondarrayboundswhile(l+1!=r){//Stopwhenlandrmeet_inti=(l+r)/2一;//Checkmiddleofremainingsubarrayif(K<array[i])r=i;//Inlefthalfif(K==array[i])returni;//Founditif(K>array[i])l=i//Inrighthalf}——//KisnotinarrayorthegreatestvalueislessthanKifK<array[n-1]orr!=nthenreturnr;//thefirstintegerwiththeleastvaluegreaterthanK//whenKitselfdoesnotappearinthearrayelsereturnERROR;//thegreatestvalueinthearrayislessthanK}⑵Theheightoftheshortesttreeandthetallesttreewithbothnnodesisrespectively
_2_orn(n<2)and__n_,supposethattheheightoftheone-nodetreeis1.A3-aryfulltreewithninternalnodeshas__3n+1_nodes.(6scores)Pleasecalculatethenumberofbinarytreesindifferentshapewith6nodesintotal,and6nodes?(4scores)2nodes:2shapes3nodes:rootwith1and2canbeallocatedtoleftandrightso1+2+2=54nodes:3canbeallocatedas0,3;1,2;2so5+5+2+2=145nodes:14+14+5+5+4=426nodes:32+32+14+14+5*2*2=132,C2nn/n+1AcertainbinarytreehasthepostorderenumerationasDCBEHJIGFAandtheinorderenumerationasBCDAEFGHIJ.Trytodrawthebinarytreeandgivethepostorderenumeration.(Theprocessofyoursolutionisrequired!!!)(6scores)preorderenumeration:ABCDFEGIHJ5.Designanalgorithmtotransferthescorereportfrom100-pointto5-point,thelevelEcorrespondingscore<60,6cH69beingD,70〜79beingC,80〜89asB,score>=90asA.Thedistributiontableisasfollowing.Pleasedescribeyouralgorithmusingadecisiontreeandgivethetotalpathlength.(6scores)Scorein100-point0-5960-6970-7980-8990-100Distributionrate5%10%45%35%5%solution:thedesignlogicistobuildaHuffmantreeTotallength:4*10%+10%*3+35%*2+45%=1.85,the0-false,1-trueasthelogicbranches.Recoveryageneraltreeasfollowingtransferredfromabinarytree.(4scores)TracebyhandtheexecutionofQuicksortalgorithmonthearray:inta[]={44,77,55,99,66,33,22,88,79}Thepivotis66inthefirstpass,thesecondis55and88,thethirdis33and77,thefouris22,andsoontillthealgorithmisfinished.(6scores)initial:44,77,55,99,66,33,22,88,79pass1:442255336699778879TOC\o"1-5"\h\zpass2:442233556679778899pass3:332244556677798899pass4:223344556677798899finalsortedarray:223344556677798899(a)Describesimplythemaintasksofthetwophasesofexternalsorting.(4scoresThetaskoffirstphaseistobreakthefilesintolargeinitialrunsbyreplacementselection;thesecondphaseistomergetherunstogethertoformasinglesortedrunfile.(b)Assumethatworkingmemoryis512KBbrokenintoblocksof4096bytes(thereisalsoadditionalspaceavailableforI/Obuffers,programvariables,etc.)Whatistheexpectedsizeforthelargestfilethatcanbemergedusingreplacementselectionfollowedbytwopassesofmulti-waymerge?Explainhowyougotyouranswer.(4scores)Sinceworkingmemoryis512KBandtheblocksizeis4KB,theworkingmemoryholds128blocks.Theexpectedrunlengthis1024KB,soasinglepassofmultiwaymergeformsrunsoflength1024KB*128=128MB.Thesecondpassthenformsarunaslargeas128MB*128=16GB.Assumeadiskdriveisconfiguredasfollows.Thetotalstorageisapproximately675Mdividedamong15surfaces.Eachsurfacehas612tracks;thereare144sectors/track,512byte/sector,and16sectors/cluster.Thediskturnsat7200rmp(8.33ms/r).Thetrack-to-trackseektimeis20ms,andtheaverageseektimeis80ms.Nowhowlongdoesittaketoreadallofthedataina380KBfileonthedisk?Assumethatthefile'sclustersarespreadrandomlyacrossthedisk.AseekmustbeperformedeachtimetheI/Oreadermovestoanewtrack.Showyourcalculations.(Theprocessofyoursolutionisrequired!!!)(6cores)Aclusterholds16*0.5K=8K.Thus,thefilerequires380/8=47.5clusters.Thetimetoreadaclusterisseektimetothecluster+latencytime+(interleaffactorxrotation
time).Averageseektimeisdefinedtobe80ms.Latencytimeis0.5*8.33,andclusterrotationtimeis47.5*(16/144)*8.33.Seektimeforthetotalfilereadtimeis47*(80+0.5*600/72+(16/144)*600/72)+(80+0.5*600/72+(8/144*600/72))=4083.98msUsingclosedhashing,withdoublehashingtoresolvecollisions,insertthefollowingkeysintoahashtableofelevenslots(theslotsarenumbered0through10).ThehashfunctionstobeusedareH1andH2,definedb
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 【正版授权】 IEC 60793-1-44:2023 EN Optical fibres - Part 1-44: Measurement methods and test procedures - Cut-off wavelength
- 【正版授权】 IEC 60748-11:1990/AMD2:1999 EN-FR Amendment 2 - Semiconductor devices - Integrated circuits - Part 11: Sectional specification for semiconductor integrated circuits excluding hybrid c
- 【正版授权】 IEC 60747-16-4:2004+AMD1:2009 CSV EN-D Semiconductor devices - Part 16-4: Microwave integrated circuits - Switches
- 【正版授权】 IEC 60745-2-9:2003+AMD1:2008 CSV EN-FR Hand-held motor-operated electric tools - Safety - Part 2-9: Particular requirements for tappers
- 【正版授权】 IEC 60745-2-1:2003+AMD1:2008 CSV EN-FR Hand-held motor-operated electric tools - Safety - Part 2-1: Particular requirements for drills and impact drills
- 【正版授权】 IEC 60728-13-1:2017 EN-FR Cable networks for television signals,sound signals and interactive services - Part 13-1: Bandwidth expansion for broadcast signal over FTTH system
- 【正版授权】 IEC 60721-3-2:2018 EN-FR Classification of environmental conditions - Part 3-2: Classification of groups of environmental parameters and their severities - Transportation and Handling
- 【正版授权】 IEC 60695-1-20:2016 EN-FR Fire hazard testing - Part 1-20: Guidance for assessing the fire hazard of electrotechnical products - Ignitability - General guidance
- 【正版授权】 IEC 60695-11-20:1999/AMD1:2003 EN-FR Amendment 1 - Fire hazard testing - Part 11-20: Test flames - 500 W flame test methods
- 【正版授权】 IEC 60674-3-2:2019 EN-FR Specification for plastic films for electrical purposes - Part 3: Specifications for individual materials - Sheet 2: Requirements for balanced biaxially orien
- 北京市石景山区2022-2023学年七年级下学期期末地理试题
- 2024年上海市中考语文真题(无答案)
- 部编版四年级语文下册段落句子病句修改
- pdms三维动画review操作手册
- 小麦检化验PPT课件
- 钢管进场验收抽检记录表
- 明清进步思想和启蒙运动比较.ppt
- 公务用车派车单、车辆维修保养申请单(修订版)
- 二年级乘除法口算题大全500题(可直接打印)
- 商用汽车空气悬架系统设计规范
- 流动红旗方案
评论
0/150
提交评论