河南電大數(shù)據(jù)結(jié)構(gòu)期末復(fù)習(xí)題(歷年考試題)(Henan TV University data structure review )_第1頁
河南電大數(shù)據(jù)結(jié)構(gòu)期末復(fù)習(xí)題(歷年考試題)(Henan TV University data structure review )_第2頁
河南電大數(shù)據(jù)結(jié)構(gòu)期末復(fù)習(xí)題(歷年考試題)(Henan TV University data structure review )_第3頁
河南電大數(shù)據(jù)結(jié)構(gòu)期末復(fù)習(xí)題(歷年考試題)(Henan TV University data structure review )_第4頁
河南電大數(shù)據(jù)結(jié)構(gòu)期末復(fù)習(xí)題(歷年考試題)(Henan TV University data structure review )_第5頁
已閱讀5頁,還剩5頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)

文檔簡介

1、河南電大數(shù)據(jù)結(jié)構(gòu)期末復(fù)習(xí)題5(歷年考試題)(Henan TV University data structure review 5)1., the time complexity of the following program segment is (C). For (int i=0; im; i+) for (int j=0; jlink=S; B.s one link=top one link; top one link=S; C.S-link=top; top-S; D.s one link=top; top-top one link;6. the height of a fully

2、two fork tree with 35 nodes is (A). Suppose the height of the empty tree is one L. A.5 B.6 C.7 D.87., the time complexity of inserting a new element into a heap with n nodes is (C). A.O (1), B.0 (n), C.O (log2n), D.O (nlog2n)8. in a AVL tree, the range of equilibrium factor for each node is (A). A.

3、one l to 1 B., one 22 C.1 to 2 D.O to 19. an undirected graph with n vertices and N edges must be (B). A. connected, B. disconnected, C. acyclic, D. has loopTwo, fill in, fill in the appropriate content in above (every day 2 points, L4 points)1. data structures include three aspects: logical structu

4、re, storage structure and operation of data.2. the space taken by a one-dimensional array is continuous. But array elements are not necessarily sequentially accessed, usually accessed by element (subscript (or ordinal number).3. the upper triangular part or the lower triangular part of a n rank symm

5、etric matrix is compressed in a one-dimensional array, and the one-dimensional array needs at least n (n+1) / 2 elements.4. for a tree with n nodes, the sum of the degrees of all nodes in the tree is (n - 1).5. at the height of an ideal balance of 3, the two fork tree contains at least 8 nodes, assu

6、ming that the height of the root node is 0.6. assumptions on the length of n=50 ordered binary search table, then the bottom nodes of decision tree in the corresponding to (19) a.7. adjacency matrix storage map, the storage space and the number of vertices.Three 、 judgment questions. Right in front

7、of each item correctly said or crossed said (2 points per question wrong. A total of 14 points(x) 1. algorithms and procedures should have some of the following features: input, output, certainty, poverty, validity.(V) 2. character string of length N storage array,The array length is at least n+1.(V

8、) 3. in the chain chain said in a circular queue, can do not set the team head pointer, the tail pointer team is only provided at the end of the chain.(x) 4. adjacency matrix is suitable for sparse graph representation, adjacency table is suitable for dense graph representation.(V) 5. on an undirect

9、ed graph of a depth first search traversal can visit all vertices in.(*) 6. in the order of the structure of the search index, the index table can only take a sequential search, binary search can not be used.(V) of each vertex figure 7. is the number of people, it is not inherent, so it can be chang

10、ed according to need.Four, operations (to match each 6 points, a total of 30 points)1. assume that a generalized table of two trees is represented by a (b (c), D (E, f), and write the results of its order, sequence, and layer traversal.Middle order: C, B, a, e, D, F, sequence: C, B, e, F, D, F, a by

11、 layer: A, B, D, C, e, a.2. a one-dimensional array all2 stored in the ordered list (15, 26, 34, 39, 45, 56, 58, 63, 74, 76, 80, 86), according to the decision tree corresponding to the binary search, write the decision tree for moderate number of nodes 1, and calculated the average search length su

12、ccessful search in case of equal probability. Number of nodes with L degrees: 5 average search length: 37/123. assumed a linear sequence (38, 42, 55, 15, 23, 44, 30, 74, 48, 26), according to the linear elements in the sequence to generate a sequence of two binary search trees, for the two binary se

13、arch tree in the left subtree for all single node, right empty empty subtrees of all single node and all the leaf nodes, please write the order from small to large values according to the node. The left subtree is empty of all single nodes: L5, 23, 42, 44, the right subtree is empty of all single no

14、des: 30, all leaf nodes: 26, 48, 744. it is known that the vertex set V and the edge set G of a graph are: V=1, 2, 3, 4, 5, 6, E=, 3, , , , 1, , , 5, 6, , 3, 5, C, C, C, C, C, C, C, C, D, C, C, C, D, C, C, C, C, C, D, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C

15、, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C;Suppose that the graph is represented by an adjacency table, and that the edges of each vertex adjacency table are linked by the order of the minor number of the terminal number:(1) starting from vertex L, we obtain the sequence of vertices obtaine

16、d by depth first search; (2) 9, N, point 1, proceed from the sequence of vertices obtained by breadth first search. (1):1, 2, 4, 5, 3, 6 (2),:1, 2, 3, 4, 5, 65. known a data sequence is 16, 45, 27, 23, 41, 15, 56, 64, please adjust it to one of the largest heap. Max heap: 64, 45, 56, 23, 41, 15, 27,

17、 16Five, algorithm analysis questions every day (6 points. A total of 12 points1. The following algorithm functions as follows: combine two ordered single linked tables into an ordered single chain table and return its header pointer. Read the algorithm and fill in the appropriate content on the hor

18、izontal line.ListNode*Mergel (ListNode*.&, PL, ListNode*&p2)P =新思路:思路:*,* F = P;當(dāng)(P1)!= null和P2!= null)如果(PL 數(shù)據(jù))P -鏈接= PL;pl2p1一鏈接、P = P一鏈接;別的 p -鏈接= P2;P2 = P2一鏈接;如果(PL)!= null)P -鏈接= PL;其他 1ink = P2 P;空;返回F一鏈接:2。已知二叉樹中的結(jié)點類型bintreenode定義為:結(jié)構(gòu)bintreenode 數(shù)據(jù)域;bintreenode *左、右;其中數(shù)據(jù)為結(jié)點值域左右,和分別為指向左、右子女結(jié)點的指針域。根據(jù)下面算法的定義指出其功能算法中參數(shù)BT指向一棵二叉樹。bintreenode * btreeswopx(bintreenode * BT)如果(bt = NULL)返回null;別的BinTreeNode * PT =新BinTreeNode;PT一BT一數(shù)據(jù)數(shù)據(jù);PT一右BTreeSwopX(BT一左);PT一左= BTreeSwopX(BT -右);回PT;算法功能:生成一棵新二叉樹并返回樹根指針,該二叉樹是已知二叉樹BT中所有結(jié)點的左、右子樹(或左、右孩子的值)交換的

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論