09數(shù)據(jù)結(jié)構(gòu)與算法試題_第1頁(yè)
09數(shù)據(jù)結(jié)構(gòu)與算法試題_第2頁(yè)
09數(shù)據(jù)結(jié)構(gòu)與算法試題_第3頁(yè)
09數(shù)據(jù)結(jié)構(gòu)與算法試題_第4頁(yè)
09數(shù)據(jù)結(jié)構(gòu)與算法試題_第5頁(yè)
全文預(yù)覽已結(jié)束

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

2009級(jí)(2010學(xué)年秋季學(xué)期《SE211數(shù)據(jù)結(jié)構(gòu)與算法》期末試題(B卷(考試形式: 考試時(shí)間:2小時(shí)考試作弊不授予學(xué)士學(xué)位 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(以列序?yàn)橹餍?.Ifthebaseaddressis10000andeachelementoccupiestwostorageunit,thenthestorageaddressofa[32,58]is().(無(wú)第0行第0列元素) D)Noneof LetAbean×nsymmetricmatrix(對(duì)稱矩陣)Inordertosavememoryitslowertriangularis(下三角)storedinaone-dimensionalarrayB[1..n(n+1)/2]byrow.Thesubscriptposition(下標(biāo))kofanyelementaij(i≥j)inlowertriangularis(對(duì)下三角部分中任一元素aij(i≥j)在一維數(shù)組B的下標(biāo)位置k值是)() C)i(i+1)/2+j-1GiventwostringsAandB,theoperationtosearchthefirstpositionofBinAiscalled( B)patternmatchingC)substring D)stringlengthThepost-orderandthein-ordersequencesofabinarytreearedabecanddebac.Thepreorderis(). Useanadjacencytable(鄰接表)torepresentandirectedgraphincludingnverticesandedges,thetimecomplexityofdeletingalledgesassociatedwithavertexis( Howmanyminimumspanningtreesdoesanundirectedgraphhas?(morethanoneoronlymaybenotDeterminingwhetherthereisaloopinadirectedgraph,wecanusetopologysortingaswellas()searchingmethodforthecriticalpath(求關(guān)鍵路徑方法breadth-firsttraversaldepth-firsttraversalUsingthebreadth-firstalgorithmtotraversethegraphrepresentedbyanadjacencytable,weshouldusethedatastructurenamed()toimplementit. Usingthedepth-firstalgorithmtotraversethegraphrepresentedbyanadjacencytable,weshouldusethedatastructurenamed()toimplementit. Ifthereexistsamappingrelationshipbetweenthememoryaddressofanodeandthekeyword(結(jié)點(diǎn)的存儲(chǔ)地址與其關(guān)鍵字之間存在某種映射關(guān)系),wecalledthestorage第3頁(yè)/第3頁(yè)/5scatter(Hash)storagelinkedstorageindexstorage Whichkindofsortingalgorithmweused?(Selection B)shell C)merge D)quick BlankThetimecomplexity “i=1;while(i<=n) Thetimecomplexityofaccessanynodeinthecontiguouslist(順序表)is ,sowecalledthecontiguouslistthe datastructure.Ifthereexistacompletebinarytree(完全二叉樹(shù))including768nodes,thenthenumberoftheleafnodeis Ifthereexistak-waytree(K叉樹(shù))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的二進(jìn)制等長(zhǎng)編碼方案表示).Inthisexample,comparetheadvantagesanddisadvantagesofthesetwomethods.(9%)GivenagraphG,seefigure1.TrytofindouttheMinimumspanningtree(最小生成樹(shù)),anddrawthelogicalstructuralgraph(邏輯結(jié)構(gòu)圖).ShowtheStorageforgraphG,withtwodifferentrepresentations(hint:useadjacencymatrixandadjacencytable).Inthefollowingsequenceofkeys,insertthekeys,intheordershown,tobuildthemintoanAVLtree.Pleasedrawtheillustrationfiguresforthewholeprocedure.(9%) Reverse(逆轉(zhuǎn)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. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論