![電大數(shù)據(jù)結(jié)構(gòu)(本)期末綜合練習二小抄_第1頁](http://file2.renrendoc.com/fileroot_temp3/2021-8/28/463cf30d-78e0-4153-a3ae-a001c2d18e84/463cf30d-78e0-4153-a3ae-a001c2d18e841.gif)
![電大數(shù)據(jù)結(jié)構(gòu)(本)期末綜合練習二小抄_第2頁](http://file2.renrendoc.com/fileroot_temp3/2021-8/28/463cf30d-78e0-4153-a3ae-a001c2d18e84/463cf30d-78e0-4153-a3ae-a001c2d18e842.gif)
![電大數(shù)據(jù)結(jié)構(gòu)(本)期末綜合練習二小抄_第3頁](http://file2.renrendoc.com/fileroot_temp3/2021-8/28/463cf30d-78e0-4153-a3ae-a001c2d18e84/463cf30d-78e0-4153-a3ae-a001c2d18e843.gif)
![電大數(shù)據(jù)結(jié)構(gòu)(本)期末綜合練習二小抄_第4頁](http://file2.renrendoc.com/fileroot_temp3/2021-8/28/463cf30d-78e0-4153-a3ae-a001c2d18e84/463cf30d-78e0-4153-a3ae-a001c2d18e844.gif)
![電大數(shù)據(jù)結(jié)構(gòu)(本)期末綜合練習二小抄_第5頁](http://file2.renrendoc.com/fileroot_temp3/2021-8/28/463cf30d-78e0-4153-a3ae-a001c2d18e84/463cf30d-78e0-4153-a3ae-a001c2d18e845.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、專業(yè)好文檔數(shù)據(jù)結(jié)構(gòu)(本)期末綜合練習二一、單項選擇題1從n個數(shù)中選取最大元素( )。 a基本操作是數(shù)據(jù)元素間的交換 b算法的時間復雜度是o(n) c算法的時間復雜度是o(n2) d需要進行(n+1)次數(shù)據(jù)元素間的比較2線性表采用鏈式存儲時,其地址( )。a一定是不連續(xù)的 b必須是連續(xù)的c部分地址必須是連續(xù)的 d可以連續(xù)也可以不連續(xù)3設(shè)head為非空的單向循環(huán)鏈表頭指針,p指向鏈表的尾結(jié)點,則滿足邏輯表達式( )的值為真。ap-next=null bp-next= =headcp-next=head dp= =null4帶頭結(jié)點的單向鏈表的頭指針為head,該鏈表為空的判定條件是( )的值為真。
2、ahead = = null bhead-next= =headchead = =head-next dhead-next= = null5設(shè)順序存儲的線性表長度為n,要刪除第i個元素,按課本的算法,當i=( )時,移動元素的次數(shù)為3a3 bn/2 cn-3 d36設(shè)順序存儲的線性表長度為n,對于插入操作,設(shè)插入位置是等概率的,則插入一個元素平均移動元素的次數(shù)為( )。an bn/2 cn-1 dn-i+17一個棧的進棧序列是a,b,c,d,則棧的不可能的出棧序列是( )。adcba bbcadccbad dadbc 8一個棧的進棧序列是5,6,7,8,則棧的不可能的出棧序列是( )(進出棧操
3、作可以交替進行)a7,6,8,5 b5,8,6,7c7,6,5,8 d8,7,6,59設(shè)有一個帶頭結(jié)點的鏈隊列,隊列中每個結(jié)點由一個數(shù)據(jù)域data和指針域next組成,front和rear分別為鏈隊列的頭指針和尾指針,要執(zhí)行出隊操作,用x保存出隊元素的值,p為指向結(jié)點類型的指針,可執(zhí)行如下操作:p=front-next;x=p-data; 然后指行( )。afront=p-next; bfront-next =p;cfront=p; dfront-next=p-next;10棧和隊列的相同點是( )。a都是后進先出 b都是后進后出c邏輯結(jié)構(gòu)與線性表不同 d邏輯結(jié)構(gòu)與線性表相同,都是操作規(guī)則受到
4、限制的線性表11在c語言中,存儲字符串“abcd”需要占用( )字節(jié)。a4 b2 c5 d312在c語言中,利用數(shù)組a存放字符串“hello”,以下語句中正確的是( )。achar a10= “hello”; bchar a10; a=“hello”;cchar a10= hello; dchar a10=h,e,l,l,o;13設(shè)有一個10階的對稱矩陣a,采用壓縮存儲方式將其下三角部分以行序為主序存儲到一維數(shù)組b中。(矩陣a的第一個元素為a1,1,數(shù)組b的下標從1開始),則矩陣元素a5,3對應(yīng)一維數(shù)組b的數(shù)組元素是( )。ab18 bb8 cb13 db1014設(shè)有一個15階的對稱矩陣a,采
5、用壓縮存儲方式將其下三角部分以行序為主序存儲到一維數(shù)組b中。(矩陣a的第一個元素為a1,1,數(shù)組b的下標從1開始),則數(shù)組元素b13對應(yīng)a的矩陣元素是( )。aa5,3 ba6,4 ca7,2 da6,815深度為5的完全二叉樹共有20個結(jié)點,則第5層上有( )個結(jié)點(根所在結(jié)點為第一層)。a3 b8 c5 d616一棵完全二叉樹共有30個結(jié)點,則該樹一共有( )層(根結(jié)點所在層為第一層)。a6 b4 c3 d517已知一個圖的所有頂點的度數(shù)之和為m,且m是以下4中情況之一,則m只可能是( )。a9 b7 c15 d818以下說法正確的是( )。 a連通圖g的生成樹中不一定包含g的所有頂點b連
6、通圖g的生成樹中一定要包含g的所有邊c連通圖g一定存在生成樹d連通圖g的生成樹一定是唯一的19線性表只要以( )方式存儲就能進行折半查找。a鏈接 b順序 c關(guān)鍵字有序的順序 d二叉樹20對二叉排序樹進行( )遍歷,遍歷所得到的序列是有序序列。 a按層次 b前序 c中序 d后序21對n個元素進行冒泡排序若某趟冒泡中只進行了( )次元素間的交換,則表明序列已經(jīng)排好序。 a1 b2 c0 dn-122以下排序算法中,在一趟排序過程中,除了其它相關(guān)操作外,只進行一次元素間的交換的算法是( )。 a冒泡 b直接選擇 c直接插入 d折半插入23在對一組元素(64,48,106,33,25,82,70,55
7、,93)進行直接插入排序時,當進行到要把第7個元素70插入到已經(jīng)排好序的子表時,為找到插入位置,需進行( )次元素間的比較(指由小到大排序)。a6 b2 c3 d424對長度為n的線性表進行順序查找,在等概率情況下,平均查找長度為( )。 an b(n+1)/2 c2n dn-125如圖,若從頂點a出發(fā)按廣度優(yōu)先搜索法進行遍歷,則可能得到的頂點序列為( )。abecdfg aacebdgf bacfedgb cabecdgfdabecfdg 26如圖若從頂點a出發(fā)按深度優(yōu)先搜索法進行遍歷,則可能得到的頂點序列為( )。abecdfg aacfgedbbaedcbgfcacfebdgdaecbd
8、gf27一棵哈夫曼樹有10個非葉子結(jié)點(非終端結(jié)點),該樹總共有( )個結(jié)點。a21 b20 c22 d1928一棵哈夫曼樹有12個葉子結(jié)點(終端結(jié)點),該樹總共有( )個結(jié)點。a21 b22 c23 d2429隊列的插入操作在( )進行。 a隊頭 b隊尾 c隊頭或隊尾 d在任意指定位置30隊列的刪除操作在( )進行。 a隊尾 b隊頭 c隊頭或隊尾 d在任意指定位置二、填空題1通??梢园涯吵鞘兄懈鞴徽军c間的線路圖抽象成_ _結(jié)構(gòu)。2結(jié)構(gòu)中的元素之間存在多對多的關(guān)系稱為_ _結(jié)構(gòu)。3要在一個單向鏈表中刪除p所指向的結(jié)點,已知q指向p所指結(jié)點的直接前驅(qū)結(jié)點,若鏈表中結(jié)點的指針域為next,則可執(zhí)
9、行_ _ _。4設(shè)有一個單向循環(huán)鏈表,結(jié)點的指針域為next,頭指針為head,指針p指向表中某結(jié)點,若邏輯表達式_的結(jié)果為真,則p所指結(jié)點為尾結(jié)點。5設(shè)有一個鏈棧,棧頂指針為hs,現(xiàn)有一個s所指向的結(jié)點要入棧,則可執(zhí)行操作_ _ 和hs=s;6設(shè)有一個鏈棧,棧頂指針為hs,現(xiàn)有一個s所指向的結(jié)點要入棧,則可執(zhí)行操作s- next=hs; _ _。7在一個不帶頭結(jié)點的非空鏈隊中,f和r分別為隊頭和隊尾指針,隊結(jié)點的數(shù)據(jù)域為data,指針域為next,若要進行出隊操作,并用變量x存放出隊元素的數(shù)據(jù)值,則相關(guān)操作為_ _; _ _ _。8在一個鏈隊中,f和r分別為隊頭和隊尾指針,隊結(jié)點的指針域為n
10、ext,s指向一個要入隊的結(jié)點,則入隊操作為_ _;_ _;9順序存儲字符串“abcd”需要占用_個字節(jié)。10循環(huán)隊列的最大存儲空間為maxsize=6,采用少用一個元素空間以有效地判斷??栈驐M,若隊頭指針front=4,當隊尾指針rear= _ _時隊滿,隊列中共有_個元素。11一棵二叉樹葉結(jié)點(終端結(jié)點)數(shù)為5,單分支結(jié)點數(shù)為2,該樹共有_個結(jié)點12程序段 char *s=”abcd”;n=0; while(*s!=0) if(*sa&*sdata=x; _(2)_; _(3)_; 2設(shè)線性表為(6,10,16,4),以下程序用說明結(jié)構(gòu)變量的方法建立單向鏈表,并輸出鏈表中各結(jié)點中的數(shù)據(jù)。
11、 #define null 0 void main( ) node a,b,c,d,*head,*p;a.data=6;b.data=10;c.data=16;d.data=4; /*d是尾結(jié)點*/head= (1) ;a.next=&b;b.next=&c;c.next=&d; (2) ; /*以上結(jié)束建表過程*/p=head; /*p為工作指針,準備輸出鏈表*/do printf(“%dn”, (3) ); (4) ; while( (5) );3以下函數(shù)在head為頭指針的具有頭結(jié)點的單向鏈表中刪除第i個結(jié)點, struct node int data;struct node *next
12、;typedef struct node node int delete(node *head,int i )node *p,*q; int j; q=head;j=0; while(q!=null)&( _(1)_) _(2)_;j+; if(q=null) return(0); p= _(3)_; _(4)_=p-next; free(_(5)_); return(1);4以下程序是中序遍歷二叉樹的遞歸算法的程序,完成程序中空格部分(樹結(jié)構(gòu)中左、右指針域分別為left和right,數(shù)據(jù)域data為字符型,bt指向根結(jié)點)。void inorder (struct btreenode *bt
13、) if(bt!=null) (1) ; (2) ; (3) ; 答案一、單項選擇題(每小題2分,共30分)1b 2d 3b 4d 5c 6b 7d 8b 9d 10d 11c 12a 13c 14a 15c 16d 17d 18c 19c 20c 21c 22b 23c 24b 25c 26a 27a 28c 29b 30b二、填空題(每題2分,共24分)1圖狀2圖狀3q-next= p-next;4p-next= =head;5s-next=hs;6hs=s;7x=f-data; f=f-next;8r-next=s;r=s;95103;511111221321141015、樹形16、深度
14、優(yōu)先;廣度優(yōu)先17線性 18圖狀(網(wǎng)狀) 19gdbeihfca20 2n-121正確22順序存儲 鏈式存儲23關(guān)鍵字相等的記錄24關(guān)鍵字相等的記錄 三、綜合應(yīng)用題1(1) 45 40 65 43 35 95 35 40 65 43 35 95 35 40 65 43 65 95 35 40 43 43 65 95 35 40 43 45 65 95(2) 40 45 65 43 35 95 40 43 45 65 35 95 35 40 43 45 65 952(1)s=(node*)malloc(sizeof(node);s-data=1;(2)p-next=s;s-next= null;
15、free(s)(3)head = head -next;(4)p1-next= p-next;p-next=p1;16423252576782428267525732161023(1)102初始樹 堆(2)102,52,42,82,16,67,32,572212130191502515200100104(1)(2)4次;3次5038821311064165(1)(2)三次;四次6246167318514(1)(2)中序遍歷 中序 2,3,4,5,6,7,14,16,18四、程序填空題1(1)sizeof (struct node)(2)p-next=top(3)top=p2 (1)&a(2)d
16、next=null(3)p-data(4)p=p-next(5)p!=null3(1)jnext(3)q-next(4)q-next(5)p4 (1)inorder(bt-left)(2)printf(“%c”,bt-data)(3) inorder(bt-right)if we dont do that it will go on and go on. we have to stop it; we need the courage to do it.his comments came hours after fifa vice-president jeffrey webb - also in
17、 london for the fas celebrations - said he wanted to meet ivory coast international toure to discuss his complaint.cska general director roman babaev says the matter has been exaggerated by the ivorian and the british media.blatter, 77, said: it has been decided by the fifa congress that it is a non
18、sense for racism to be dealt with with fines. you can always find money from somebody to pay them.it is a nonsense to have matches played without spectators because it is against the spirit of football and against the visiting team. it is all nonsense.we can do something better to fight racism and d
19、iscrimination.this is one of the villains we have today in our game. but it is only with harsh sanctions that racism and discrimination can be washed out of football.the (lack of) air up there watch mcayman islands-based webb, the head of fifas anti-racism taskforce, is in london for the football as
20、sociations 150th anniversary celebrations and will attend citys premier league match at chelsea on sunday.i am going to be at the match tomorrow and i have asked to meet yaya toure, he told bbc sport.for me its about how he felt and i would like to speak to him first to find out what his experience
21、was.uefa hasopened disciplinary proceedings against cskafor the racist behaviour of their fans duringcitys 2-1 win.michel platini, president of european footballs governing body, has also ordered an immediate investigation into the referees actions.cska said they were surprised and disappointed by t
22、oures complaint. in a statement the russian side added: we found no racist insults from fans of cska.baumgartner the disappointing news: mission aborted.the supersonic descent could happen as early as sunda.the weather plays an important role in this mission. starting at the ground, conditions have
23、to be very calm - winds less than 2 mph, with no precipitation or humidity and limited cloud cover. the balloon, with capsule attached, will move through the lower level of the atmosphere (the troposphere) where our day-to-day weather lives. it will climb higher than the tip of mount everest (5.5 mi
24、les/8.85 kilometers), drifting even higher than the cruising altitude of commercial airliners (5.6 miles/9.17 kilometers) and into the stratosphere. as he crosses the boundary layer (called the tropopause),e can expect a lot of turbulence.the balloon will slowly drift to the edge of space at 120,000
25、 feet ( then, i would assume, he will slowly step out onto something resembling an olympic diving platform.below, the earth becomes the concrete bottom of a swimming pool that he wants to land on, but not too hard. still, hell be traveling fast, so despite the distance, it will not be like diving into the deep end of a pool. it will be like he is diving into the shallow end.skydiver preps for the big jumpwhen he jumps, he is expected to reach the speed of sound - 690 mph (1,110 kph) - in less than 40
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 12《家鄉(xiāng)的喜與憂》(說課稿)部編版道德與法治四年級下冊
- 2023七年級道德與法治下冊 第三單元 在集體中成長第八課 美好集體有我在 第1框憧憬美好集體說課稿 新人教版
- 二零二五年度個人借款委托轉(zhuǎn)款資金監(jiān)管合同
- 二零二五年度高端商務(wù)配司汽車租賃服務(wù)協(xié)議
- 2024-2025學年新教材高中化學 第四章 化學反應(yīng)與電能 2.1 電解原理及其規(guī)律說課稿 新人教版選擇性必修1
- 二零二五年度建筑用鋼材買賣合作協(xié)議書3篇
- 2024年春七年級道德與法治下冊 第一單元 青春時光 第一課 青春的邀約 第1框 悄悄變化的我說課稿 新人教版
- 水性油漆采購合同(2篇)
- 河道清淤項目招標合同(2篇)
- 2025年美容院美容院門店股權(quán)托管合同范本3篇
- (一模)蕪湖市2024-2025學年度第一學期中學教學質(zhì)量監(jiān)控 英語試卷(含答案)
- 完整版秸稈炭化成型綜合利用項目可行性研究報告
- 詩經(jīng)楚辭文學常識單選題100道及答案
- AI輔助的慢性病監(jiān)測與管理系統(tǒng)
- 2025中國海油春季校園招聘1900人高頻重點提升(共500題)附帶答案詳解
- 膽汁淤積性肝硬化護理
- 《數(shù)據(jù)采集技術(shù)》課件-Scrapy 框架的基本操作
- 2024版房屋市政工程生產(chǎn)安全重大事故隱患判定標準內(nèi)容解讀
- 第8課紅樓春趣同步練習(含答案)
- 死亡醫(yī)學證明書辦理委托書
- 《壓力容器安全技術(shù)監(jiān)察規(guī)程》
評論
0/150
提交評論