



下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、誠信應(yīng)考,考試作弊將帶來嚴(yán)重后果!(1) Pickthegrowthratethatcorrespondstothemostinefficientalgorithmasngetslarge:(C)(A)2n3(B)2n2logn(C)n!(D)2nAnalgorithmmustbeordoallofthefollowingEXCEPT:(B)(A)Partiallycorrect(B)Ambiguous(C)Canstop(D)Concretesteps(3)Ifadataelementrequires6bytesandapointerrequires2bytes,thenalinkedlis
2、trepresentationwillbemorespaceefficientthanastandardarrayrepresentationwhenthefractionofnon-nullelementsislessthanabout:(B)(A)1/4(B)3/4(C)4/7(D)2/3(4)Whichstatementisnotcorrectamongthefollowingfour:(C)(A)TheQuick-sortisanunstablesortingalgorithm.(B)Thenumberofemptysub-treesinanon-emptyfullbinarytree
3、isonemorethanthenumberofnodesinthetree.(C)Thebestcaseformyalgorithmisnbecominglargerandlargerbecausethatisthemostquickly.(D)Aclusteristhesmallestunitofallocationforafile,soallfilesoccupyamultipleoftheclustersize.(5)Whichofthefollowingisatruestatement:(C)(A)Ageneraltreecanbetransferredtoabinarytreewi
4、ththeroothavingbothleftchildandrightchild.(B)InaBST,thenodecanbeenumeratedsortedbyapreordertraversaltotheBST.(C)InaBST,theleftchildofanynodeislessthantherightchild,butinaheap,theleftchildofanynodecouldbelessthanorgreaterthantherightchild.(D)Aheapmustbefullbinarytree.(6)Thegoldenruleofadisk-basedprog
5、ramdesignisto:(B)(A)ImprovethebasicI/Ooperations.(B)MinimizethenumberofdiskDataStructureA 試卷第 1 頁共 5 頁華南理工大學(xué)期末考試DataStructure試卷A題號一二三四五六七八九十總分:得分評卷人)二題-答-院不-學(xué)內(nèi)線封密(注意事項(xiàng):1.考前請將密封線內(nèi)填寫清楚;2.所有答案請答在答題紙上;3.考試形式:閉卷;4.本試卷共十大題,滿分100分,考試時(shí)間120分鐘。1.Selectthecorrectchoice.(20scores,each2scores)accesses.(C)Elimina
6、tetherecursivecalls.(D)Reducemainmemoryuse.(7)GivenanarrayasAmn.SupposedthatA00islocatedat644(10)andA22isstoredat676(IO),andeveryelementoccupiesonespace沁)meansthatthenumberispresentedindecimals.Thentheelement11(IO)isatposition:(D)(A)692(B)695(C)650(D)660(8)Ifthereis1MBworkingmemory,4KBblocks,andyiel
7、d128blocksforworkingmemory.Bythemulti-waymergeinexternalsorting,theaveragerunsizeandthesortedsizeinonepassofmulti-waymergeonaverageareseparately(C)?(A)1MB,128MB(B)2MB,512MB(C)2MB,256MB(D)1MB,256MB(9)Inthefollowingsortingalgorithms,whichisthebestonetofindthefirst10biggestelementsinthe1000unsortedelem
8、ents?(B)(A)Quick-sort(B)Heapsort(C)Insertionsort(D)Replacementselection(10)Assumethatwehaveeightrecords,withkeyvaluesAtoH,andthattheyareinitiallyplacedinalphabeticalorder.Now,considertheresultofapplyingthefollowingaccesspattern:FDFGEGFADFGEifthelistisorganizedbytheMove-to-frontheuristic,thenthefinal
9、listwillbe(B).(A)FGDEABCH(B)EGFDABCH(C)ABFDGECH(D)EGFACBDH2. FilltheblankwithcorrectC+codes:(16scores)(1)Givenanarraystoringintegersorderedbydistinctvaluewithoutduplicate,modifythebinarysearchroutinestoreturnthepositionoftheintegerwiththegreatestvaluelessthanKwhenKitselfdoesnotappearinthearray.Retur
10、nERRORifthelestvalueinthearrayisgreaterthanK:(10scores)/ReturnpositionofgreatestelementKintnewbinary(intarray,intn,intK)intl=-1;intr=n;/landrbeyondarrayboundswhile(l+1!=r)/Stopwhenlandrmeetinti=(l+r)/2;/Lookatmiddleofsubarrayif(Karrayi)l=i/Inrighthalf)/KisnotinarrayorthegreatestvalueislessthanKifKar
11、ray0(orl!=-1)/thelestvalueinthearrayisgreaterthanKwithlupdatedreturnl;/whenKitselfdoesnotappearinthearrayelsereturnERROR;/theintegerwiththelestvaluegreaterthanK(2)Thenumberofnodesinacompletebinarytreeasbigaspossiblewithheighthis2h-1(suppose1-nodetreeheightis1)(3scores)(3)Thenumberofdifferentshapesof
12、binarytreeswith6nodesi_132.(3scores)3. Acertainbinarytreehasthepost-orderenumerationasEDCBIHJGFAandthein-orderenumerationasEBDCAFIHGJ.Trytodrawthebinarytreeandgivethepostorderenumeration.(Theprocessofyoursolutionisrequired!)(6scores)AAABFBFCGCGEEJJIHHpreorderenumeration:ABECDFGHIJIareoftypeint(6scor
13、es)solution(n)solutionsolution(n)2422244545822223535itaStrucforthefollowingcodefragmentsintheaveragecase.Assumethat5.Showthemin-heapthatresultsfromrunningbuildheaponthefollowingvalues(2)sum=0;for(i=1;i=i;j-sum+;4.Determine8allvariablesstoredinanarray:4,2,5,8,3,6,10,1483sum=0;for(i=0;i5;i+)for(j=0;jn
14、;j+)sum+;DCIHGJsum=0;if(EVEN(n)for(i=0;in;i+)sum+;elsesum=sum+n;B:F4555 (6scores)2_(n)BDCFIHGJ-3re6.Designanalgorithmtotransferthescorereportfrom100-pointto5-point,thelevelEcorrespondingscore=90asA.Thedistributiontableisasfollowing.Pleasedescribeyouralgorithmusingadecisiontreeandgivethetotalpathleng
15、th.(9scores)Scorein100-point0-5960-6970-7980-8990-100Distributionrate5%10%45%35%5%solution:thedesignlogicistobuildaHuffmantreeTotallength:4*10%+10%*3+15%*3+35%*2+45%logicbranches.7. Assumeadiskdriveisconfiguredasfollows.Thetotalstorageisapproximately675Mdividedamong15surfaces.Eachsurfacehas612tracks
16、;thereare144sectors/track,512byte/sector,and16sectors/cluster.Theinterleavingfactoris3.Thediskturnsat7200rmp(8.3ms/r).Thetrack-to-trackseektimeis20ms,andtheaverageseektimeis80ms.Nowhowlongdoesittaketoreadallofthedataina360KBfileonthedisk?Assumethatthefilesclustersarespreadrandomlyacrossthedisk.Aseek
17、mustbeperformedeachtimetheI/Oreadermovestoanewtrack.Showyourcalculations.(Theprocessofyoursolutionisrequired!)(9scores)Solution:Aclusterholds16*0.5K=8K.Thus,thefilerequires360/8=45clusters.Thetimetoreadaclusterisseektimetothecluster+latencytime+(interleaffactorxrotationtime).Averageseektimeisdefined
18、tobe80ms.Latencytimeis0.5*8.3,andclusterrotationtimeis3*(16/144)*8.3.Seektimeforthetotalfilereadtimeis45*(80+0.5*8.3+3*(16/144)*8.3)=3911.258. Usingclosedhashing,withdoublehashingtoresolvecollisions,insertthefollowingkeysintoahashtableofelevenslots(theslotsarenumbered0through10).Thehashfunctionstobe
19、usedareH1andH2,definedbelow.Youshouldshowthehashtableafteralleightkeyshavebeeninserted.BesuretoindicatehowyouareusingH1andH2todothehashing.(Theprocessofyoursolutionisrequired!)H1(k)=3kmod11H2(k)=7kmod10+1Keys:22,41,53,46,30,13,1,67.(9scores)=2.25,the0-false,1-trueastheSolution:H1(22)=0,H1(41)=2,H1(53)=5,H1(46)=6,noconflictWhenH1(30)=2,H2(30)=1(2+1*1)%11=3,so30entersthe3rdslot;H1(13)=6,H2(13)=2(6+1*2)%11=8,so13entersthe8thslot;H1(1)=3,H2(1)=8(3+5*8)%11=10so1enters10(passby0,8,5,2);H1(67)=3,H2(67)=10(3+2*10)%11=1so67enter
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 湖南省瀏陽市瀏陽河中學(xué)2024-2025學(xué)年初三年級模擬考試(一)語文試題含解析
- 上海市閔行區(qū)24校聯(lián)考2025屆初三下學(xué)期期中練習(xí)化學(xué)試題試卷含解析
- 新鄉(xiāng)醫(yī)學(xué)院《鑄造工藝與裝備》2023-2024學(xué)年第二學(xué)期期末試卷
- 采購合同履行合同管理標(biāo)準(zhǔn)更新重點(diǎn)基礎(chǔ)知識(shí)點(diǎn)
- 2025年工人個(gè)人工作總結(jié)范文(12篇)
- 聯(lián)通員工年終工作總結(jié) 質(zhì)量部員工年終工作總結(jié)(3篇)
- 一般員工簡短的述職報(bào)告(18篇)
- 中學(xué)英語教師述職報(bào)告(3篇)
- 上海市普陀區(qū)教育學(xué)院附屬中學(xué)2024-2025學(xué)年上學(xué)期七年級12月數(shù)學(xué)月考卷(含簡略答案)
- 期末測試卷 (1)(含答案) 2024-2025學(xué)年人教版(2024)七年級生物下冊
- 圍手術(shù)期病人安全管理
- 物理跨學(xué)科實(shí)踐:制作微型密度計(jì)+課件2024-2025學(xué)年人教版物理八年級下冊
- 泵房基坑開挖專項(xiàng)施工方案
- 幼兒園安全制度
- 人工智能在信號處理中的應(yīng)用-全面剖析
- 廣東省廣州市花都區(qū)2022-2023學(xué)年二年級下學(xué)期數(shù)學(xué)期中檢測練習(xí)卷
- 2025年江蘇淮安市漣水縣安東控股集團(tuán)招聘筆試參考題庫含答案解析
- 膽內(nèi)總管結(jié)石伴膽管炎護(hù)理查房
- 白酒營銷述職報(bào)告
- 2025年廣東韶關(guān)南雄市衛(wèi)生健康局下屬事業(yè)單位招聘工作人員67人歷年高頻重點(diǎn)模擬試卷提升(共500題附帶答案詳解)
- 世界地圖矢量圖和各國國旗 world map and flags
評論
0/150
提交評論