数据结构试题全部双语卷_第1页
数据结构试题全部双语卷_第2页
数据结构试题全部双语卷_第3页
数据结构试题全部双语卷_第4页
数据结构试题全部双语卷_第5页
已阅读5页,还剩1页未读, 继续免费阅读

付费下载

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

ONE.Single-Analgorithm(算法)isreferredto A.acalculatingB.asortingC.asequentialsetofinstructionstosolveaD.asearchingTheLinkedListisdesignedforconveniently )data Inthefourchoices, )isnotthepropertiesof Assumeasequencelistas1,2,3,4,5,6ispushedinastack(栈),animpossibleoutputsequencelistis( A.2,4,3,5,1 B.3,2,5,6,4,5,4,6,2 D.4,5,3,6,25.Aqueue(队列)isastructurethatfollowstheprincipleof( D.RandomInandRemovingthedataitematindexiinanarraywithnitems,( )itemsneedtobeshiftedleftoneposition. ThereisanalgorithmwithinsertinganitemtoaorderedSeqList(顺序链表)andstillkeetheSeqListordered.Thecomputationalefficiencyofthisinsertingalgorithmis TheaddresseswhichstoreLinkedList mustbesequential B.mustbepartlysequentialC.mustbenosequential D.canbesequentialordiscontinuousAccordingtothedefinitionofBinaryTree,therewillbe( )differentBinaryTreeswith3nodes. 10.ABinaryTreewillhave )nodesonitsleveliat Inthefollowingsortingalgorithm, isanunstable(不稳定)theinsertionsort(插入排序) B.thebubblesort(气泡法排序)C.quicksort(快速排序) Assumethatthereisanorderedlistconsistingof100dataitems,usingbinarysearch(二分法查找)tofindaspecialitem,theumcomparisonsis( TheresultfromscanningaBinarySearchTree(二叉排序树)ininordertraversalisin )order.descendingorascending D.outofToconnectnverticesinanundirectedgraph,itneeds )edgesat Inanundirectedgraphwithnvertexes,theumedgesis Theoutputfromscanningaminimumheap(小顶堆)withleveltraversal mustbeanascendingmustbedescendingmusthaveaminimumitemattheheadmusthaveaminimumitemattherearWhenarecursivealgorithm(递归算法)istransformedintoanorecursivealgorithm,astructure( )isgenerallyused. D.BinaryInthefollowingdatastructure, )isnon-linearA.Binary 19.Acircularqueue(循环队列)isemptyif( A.(rear+1)%Maxsize==front B.front==rearC.rear+1== D.(rear-1)%Maxsize==Thedifferencebetweenstaticsortingtable(静态查找表)anddynamicsortingtable(动态查找表)is( thedifferenceinlogicalthedifferenceinstoragethedifferenceofdatainsertionanddeletiononlycanbedoneindynamicsortingTWO.Blankfilling1.Aconnectedgraph 【1 Inacompletebinarythesequencenumberofnodei’sparent(ifexist)is thesequencenumberofnodei’sleftchild(ifexist)is thesequencenumberofnodei’srightchild(ifexist) 【4【5】isthefastestknownsortingalgorithmin4.Afullbinarytreeofagivenheighth(h>=1)has【6】AnundirectedgraphGhasNvertices.ThenumberofedgesofaMST(最小生成树)ofthisgraphis Commonlyusedgraphsearchmethods 【8 【9 Completethecommonqueueoperations. Status //capacityofthequeue //pointtoanarraywhichstoreselementsofthequeue *base; front //front rear //rear}SqQueue InitQueue_Sq( &Q{Q.base=(int*)malloc(MAXSIZE*sizeof(int));if(!Q.base) exit(0);Q.front=Q.rear=0; OK;}StatusEnQueue_Sq( if 【10 ERROR&Q,e)//IsthequeueQ.base[Q.rear]=e【11 OK}StatusDeQueue_Sq( &Q,int&e{if(Q.rear==Q.front) ERRORe=Q.base[Q.front]【12 OK}THREE.AnswerTrueorFalseforeachofthefollowing )1.TheMinimumSpanningTreeofthegraphisalways )2.Intreestructure,thereisexactlyonepathfromtheroottoeach )3.ForeverynodeinanAVLtree(平衡二叉树),theheightoftheleftandrightsub-treescandifferbyatmost1. )4.MaxHeap(大顶堆)canlocatethecurrentuminO(1) )5.Foranynon-emptytree,ifnisthenumberofnodesandeisthenumbersofedgesthenn=e+1. )6.Ifabinarysearchtreehaslileavesathighti(i>=1),thenli )7.Thetopologicalsortedorder(拓扑排序)ofnodesinagraph(ifitexists)isalways )8.Astackisalinearlistinwhichalladditionsarerestrictedtooneend,calledtheAstackisalsocalledaFIFO 9.Thearray2317146131015712isaheap堆 )10WecanuseTimeComplexityandSpaceComplexitytoevaluatetheefficiencyofanFOUR.Assumethatweareusingthehashingfunctionhash(key)=keymod11andthefollowingsequenceofkeyscreateahashtable:12,44,13,88,23,94,11,39,20,16,5.theresultinghashtable:Uselinearprobing线性探测)withanincrementofFIVE.YouaregivenanundirectedGiveadjacencymatrix(邻接矩阵representationofthisConstructaminimumspanningtree,usingtheKruskalalgorithm(算法).Drawtheprogressofcreation.SIX.SupposetheinordertraversalsequencesofabinarytreeisHDBIEAFJCGK,thepostordertraversalsequencesisHDIEBJFKGCA.Pleaseconstructthebinarytree,showthefinalresultandwriteoutthepreordertraversalsequenceofthebinarytree.SEVEN.Firststep,showtheresultofinserting40,22,53,99,37,13,61,80,70,24intoaninitiallyemptybinarysearchtree.Thenshowtheresultofdeletingtheroot.EIGHT.Thefrequencyofthesymbols{a,b,c,d,e,f}is{0.07,0.09,0.12,0.22,0.27}.ConstructtheHuffmantreeandgivetheHuffmancodeofthesymbols{a,b,c,d,e,f}.NINE.GettheprogramrunningOperationof//SupposeStackandcorrespondingfunctionsalreadybecorrecteddefinedvoidmain(){ S x,y;InitStack(S);x=’c’ y=’t’Push(S,x) Push(S,’u’) Push(S,y)Pop(S,x) Push(S,’r’) Push(S,x)Push(S,y) Pop(S,y) Push(S,’s’)while(!StackEmpty(S)) Pop(S,y); printf(y); printf(x);}Operationofabinarytree. LeftChild(i) (2*(i)+1)voidfun1(int A[],int i,int n) Child; Tmp;for(Tmp=A[i];LeftChild(i)<n;i=Child Child=LeftChild(i)if(Child!=n-1&&A[Child+1]>A[Child]) Child++;if(Tmp<A[Child])A[i]=A[Child]; break}A[i]=Tmp}voidfun(intA[],intn i,tempfor(i=n/2;i>=0;i--fun1(A,i,n)for(i=n-1;i>0;i-- temp=A[0],A[0]=A[i],A[i]=temp;fun1(A,0,i);}}#defineN15voidmain() a[N]={5,9,3,2,99,8,7,1,77,54,23,12,88,-6,-10} i;fun(a,N);for(i=0;i<N;i++)printf("%d",a[i]);}TEN.Programming(Allmethodshavebeende

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论