欢迎来到天天文库
浏览记录
ID:34077742
大小:71.97 KB
页数:5页
时间:2019-03-03
《2012-2013(中加ds)期中试卷a答案》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、天津理工大学考试试卷2012〜2013学年度第一学期《数据结构》期中考试试卷课程代码:0666126试卷编号:1-A命题日期:2012年11月20日答题时限:45分钟考试形式:闭卷笔试得分统计表:umberScore^^InhiIVVI.Foreachquestion,choosethebestanswerandwriteitsletterclearlyasalargeplaincapitalintheanswerform・(4pointsforeachquestion,totalis40points.)ScoreN
2、ote:PleasewriteallofyouranswersinthefollowingsheetQuestionNumber12345678910AnswerACDADBBDCB1•Forasequentiallist(alistimplementedbyanarray),whichofthefollowingoperationisa0(1)algorithm?A.Accessthei-thelement(lWiWn)B.Insertanewelementafterthei-thelement(1WiWn)C.De
3、letethei-thelement(lWiWn)D.Alloftheabove2.Assumethatabinarytreewithnnodes,nodesonitsleveliatmost.A.2iB.2i+,C.2i_,D.2n3.TheaddresseswhichstoreLinkedList.A.mustbesequentialB.mustbepartlysequentialC.mustbenosequentialD.canbesequentialordiscontinuous2.ABinaryTreewil
4、lhavenodesonitsleveliatmost.A.2jB.2iC.2i+lD.2i_13.Inthecontextofthiscourse,whatarethemosttwoaspectsofalgorithmanalysis?A.Correctness&ConcisenessB.Readability&StandardizationC.Timecomplexity&SpacecomplexityD.Datacomplexity&Programcomplexity6-ConsiderthefollowingC
5、code,theBig-Ohrunningtimeis•sum=0;for(i=0;inext=p->next->nextB.p二p・>nextC-p二p・>next->nextD.ne
6、xt=p8-Inasinglylinkedlist,pandqpointto2differentnodes-Iftheelementofqisthepredecessorofp.theninsertnodesbetweenpandq.whichstatementiscorrect?A.s->next=p-next;p->next=s;B.q・>nex(=s;s->next=p;C-p->next=s->next;s->next=p;D.p->next=s;s->next=q;9.TheLinkedListisdesig
7、nedforconvenientlydataitem-A.gettingB.insertingC.findingD.locating10.Foradoublylinkedlist,ifwewanttoinsertanode(spointtoit)afterthenodethatppointto,whatshouldwedo?A.p->next=s;s->prior=p;p・>next・>prior=s;s->next=p・>next;Bep・>nex(=s;p->next->prior=s;s->prior=p;s->
8、next=p->next;C-s->prior=p;s->next=p・>next;p・>next=s;p->next->prior=s;D.s->prior=p;s->next=p->next;p->next->prior=s;p・>nex匸s;ILAnswerthefollowingquestions(Totalis40poi
此文档下载收益归作者所有