欢迎来到天天文库
浏览记录
ID:59825828
大小:37.00 KB
页数:10页
时间:2020-11-25
《华师大数据结构期中考试试卷.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、华东师范大学期中试卷2007—2008学年第二学期课程名称:______数据结构_____姓名:___________________学号:__________________专业:___________________年级/班级:__________________课程性质:专业必修一二三四五六七八总分阅卷人签名一、单项选择题(共18分,每题3分)1.Stackhasthepropertycalledlastinandfirstout,thenwhichofthefollowingdescribesthepropertyofQueue?a)Lastinandfirstoutb
2、)Firstinandlastoutc)Firstinandfirstout2.Alistofitemsfromwhichonlytheitemmostrecentlyaddedcanberemovedisknownasa()a)stackb)queuec)circularlinkedlistd)list3.Ifthefollowingfunctioniscalledwithavalueof2forn,whatistheresultingoutput?voidQuiz(intn){if(n>0){cout<<0;Quiz(n-1);cout<<1;Quiz(n-1);}}a)b
3、)c)d)e)4.Aheapisalistinwhicheachentrycontainsakey,and,forallpositionsiinthelist,thekeyatpositioniisatleaseaslargeasthekeysinpositions2i+2and(),providedthesepositionsexistinthelist.a)2ib)2i-1c)2i-2d)2i+15.GiventherecursivefunctionintFunc(/*in*/inti,/*in*/intj){if(i<11)if(j<11)returni+j;elsere
4、turnj+Func(i,j-2);elsereturni+Func(i-1,j);}whatisthevalueoftheexpressionFunc(12,15)?a)81b)62c)19d)72e)noneoftheabove6.Shellsortfinallyperformanordinary()?a)Heapsortb)Insertionsortc)Selectionsortd)Quicksort一、填空题(共22分,每空2分)1.Ifthefollowingfunctioniscalledwithavalueof75forn,theresultingoutputis
5、_______【1】_________.voidFunc(/*in*/intn){if(n>0){Func(n/8);cout<voidprint(List_entry&x){cout<mylist;for(inti=0;i<5;i++)mylist.insert(i,i);cout<<"Yourlisthave"<6、<<"elements:"<structNode{//datamembersNode_entr7、yentry;Node*next;Node*back;//constructorsNode();Node(Node_entryitem,Node*link_back=NULL,Node*link_next=NULL);};templatevoidList::set_position(intposition)const/*Pre:positi
6、<<"elements:"<structNode{//datamembersNode_entr
7、yentry;Node*next;Node*back;//constructorsNode();Node(Node_entryitem,Node*link_back=NULL,Node*link_next=NULL);};templatevoidList::set_position(intposition)const/*Pre:positi
此文档下载收益归作者所有