预览加载中,请您耐心等待几秒...
在线预览结束,喜欢就下载吧,查找使用更方便
如果您无法下载资料,请参考说明:
1、部分资料下载需要金币,请确保您的账户上有足够的金币
2、已购买过的文档,再次下载不重复扣费
3、资料包下载后请先用软件解压,在使用对应软件打开
ISingleChoice(10points)1.()Forthefollowingprogramfragmenttherunningtime(Big-Oh)is.i=0;s=0;while(s<(5*n*n+2)){i++;s=s+i;}a.O(n)b.O(n2)c.O(n1/2)d.O(n3)2.()Whichisnon-lineardatastructure_____.a.queueb.stackc.treed.sequencelist3.()Theworst-timeforremovinganelementfromasequencelist(Big-Oh)is.a.O(1)b.O(n)c.O(n2)d.O(n3)4.()Inacircularqueuewecandistinguish(区分)emptyqueuesfromfullqueuesby.a.usingagapinthearrayb.incrementingqueuepositionsby2insteadof1c.keepingacountofthenumberofelementsd.aandc()Arecursivefunctioncancauseaninfinitesequenceoffunctioncallsif.theproblemsizeishalvedateachsteptheterminationconditionismissingnousefulincrementalcomputationisdoneineachsteptheproblemsizeispositive6.()Thefullbinarytreewithheight4hasnodes.a.15b.16c.31d.327.()Searchinginanunsortedlistcanbemadefasterbyusing.binarysearchasentinel(哨兵)attheendofthelistlinkedlisttostoretheelementsaandc8.()Supposethereare3edgesinanundirectedgraphG,IfwerepresentgraphGwithaadjacencymatrix,Howmany“1”sarethereinthematrix?a.3b.6c.1d.99.()ConstructaHuffmantreebyfourleafwhoseweightsare9,2,5,7respectively.Theweightedpathlengthis___________.a.29b.37c.46d.4410.Considerthefollowingweightedgraph.ConsiderDijkstra’salgorithmonthisgraphtofindtheshortestpathswithsasastartingvertex.Whicharethefirstfourverticesextractedfromthepriorityqueuebythealgorithm(listedintheordertheyareextracted)?a.s,y,t,xb.s,y,x,zc.s,t,y,xd.s,y,x,tFig.111.Hereisanarrayoftenintegers:5389170264Supposewepartitionthisarrayusingquicksort'spartitionfunctionandusing5forthepivot.Whichshowsthearrayafterpartitionfinishes:a.5342107968b.0342157968c.3102458967d.3102458976e.NoneoftheaboveIIFillinBlank(10points)1.Forthefollowingprogramfragmenttherunningtime(Big-Oh)is.for(inti=0;i<n;i++)for(intj=0;j<=i;j++)s;//s为某种基本操作2.Westorea4×4symmetricmatrixAintoanarrayBwithrowmajororder,Storethelowertriangleonly.theindexofelementa[2][3]inBis.3.Wecanuse3vectortypetostorevalueandofnon-zeroelementsinasparsematrix.4.A_________