欢迎来到天天文库
浏览记录
ID:58698431
大小:55.50 KB
页数:10页
时间:2020-10-23
《华师大数据结构期中考试试卷(含答案).doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、..华东师范大学期中试卷2007—2008学年第二学期课程名称:______数据结构_____姓名:___________________学号:__________________专业:___________________年级/班级:__________________课程性质:专业必修一二三四五六七八总分阅卷人签名一、单项选择题(共18分,每题3分)1.Stackhasthepropertycalledlastinandfirstout,thenwhichofthefollowingdescribesthepropertyo
2、fQueue?a)Lastinandfirstoutb)Firstinandlastoutc)Firstinandfirstout2.Alistofitemsfromwhichonlytheitemmostrecentlyaddedcanberemovedisknownasa()a)stackb)queuec)circularlinkedlistd)list3.Ifthefollowingfunctioniscalledwithavalueof2forn,whatistheresultingoutput?voidQuiz(int
3、n){if(n>0){cout<<0;Quiz(n-1);cout<<1;Quiz(n-1);}}.zyzl....a)00011011b)11100100c)10011100d)01100011e)0011014.Aheapisalistinwhicheachentrycontainsakey,and,forallpositionsiinthelist,thekeyatpositioniisatleaseaslargeasthekeysinpositions2i+2and(),providedthesepositionsexi
4、stinthelist.a)2ib)2i-1c)2i-2d)2i+15.GiventherecursivefunctionintFunc(/*in*/inti,/*in*/intj){if(i<11)if(j<11)returni+j;elsereturnj+Func(i,j-2);elsereturni+Func(i-1,j);}whatisthevalueoftheexpressionFunc(12,15)?a)81b)62c)19d)72e)noneoftheabove6.Shellsortfinallyperforman
5、ordinary()?a)Heapsortb)Insertionsortc)Selectionsortd)Quicksort一、填空题(共22分,每空2分)1.Ifthefollowingfunctioniscalledwithavalueof75forn,theresultingoutputis_______【1】_________..zyzl....voidFunc(/*in*/intn){if(n>0){Func(n/8);cout<6、_______【2】__________.templatevoidprint(List_entry&x){cout<mylist;for(inti=0;i<5;i++)mylist.insert(i,i);cout<<"Yourlisthave"<7、traverse(print);mylist.clear();for(i=1;i<3;i++)mylist.insert(i,i);mylist.traverse(print);}3.Readthefollowingprogramandfilltheblanktocompletethemethod.templatestructNode{//datamembersNode_entryentry;Node*next;Node*back;//constr8、uctorsNode();Node(Node_entryitem,Node*link_back=NULL,Node*link_next=NULL);};templatevoidLi
6、_______【2】__________.templatevoidprint(List_entry&x){cout<mylist;for(inti=0;i<5;i++)mylist.insert(i,i);cout<<"Yourlisthave"<7、traverse(print);mylist.clear();for(i=1;i<3;i++)mylist.insert(i,i);mylist.traverse(print);}3.Readthefollowingprogramandfilltheblanktocompletethemethod.templatestructNode{//datamembersNode_entryentry;Node*next;Node*back;//constr8、uctorsNode();Node(Node_entryitem,Node*link_back=NULL,Node*link_next=NULL);};templatevoidLi
7、traverse(print);mylist.clear();for(i=1;i<3;i++)mylist.insert(i,i);mylist.traverse(print);}3.Readthefollowingprogramandfilltheblanktocompletethemethod.templatestructNode{//datamembersNode_entryentry;Node*next;Node*back;//constr
8、uctorsNode();Node(Node_entryitem,Node*link_back=NULL,Node*link_next=NULL);};templatevoidLi
此文档下载收益归作者所有