《数据结构(c语言版)第一二章习题答案(Data structure (C Language Edition) first, two chapter exercises answer)》由会员分享,可在线阅读,更多相关《数据结构(c语言版)第一二章习题答案(Data structure (C Language Edition) first, two chapter exercises answer)(23页珍藏版)》请在金锄头文库上搜索。
1、数据结构(c语言版)第一二章习题答案Data structure (C Language Edition) first, two chapter exercises answerDo not think, there is confusion; do not ask, so there is no; do not ask, so I do not know.The first chapter is introductionexercises1. briefly describe the following concepts: data, data elements, data items, d
2、ata objects, data structures, logical structures, storage structures, and abstract data typesA data structure for example 2.The meaning and relation of two aspects of logical structure and storage structure are described3. sketch the four basic relationships of logical structures and draw their diag
3、rams4. what are the two basic storage methods in which the storage structure is implemented?5. choice questions(1) in the data structureLogically, the data structure can be divided into ()A. dynamic structure and static structure, B. compact structure and non compact structureC. linear structure and
4、 nonlinear structure, D. internal structure and external structure(2) the data form is independent of the form, content, relative position and number of data elements themselvesA. storage structure, B. storage implementationImplementation of C. logic structure D. operation(3) usually require all the
5、 data elements in the same logical structure to have the same characteristicsThis means ()A. data has the same characteristicsB. is not only the number of data items contained in the data element, but also the sameAnd the type of the corresponding data item should be consistentC. each data element i
6、s the sameD. data elements contain equal numbers of data items(4) the following statement is correctThe A. data element is the smallest unit of dataThe B. data item is the basic unit of dataThe C. data structure is a collection of data items with a structureD. some of the very different data on the
7、surface can have the same logical structure(5) the following term is not related to the storage structure of dataA. sequential queue, B. list, C. ordered table, D. chain stack(6) in the following data structures() is a nonlinear data structureA. tree, B. string, C. team, D. stack6. try to analyze th
8、e time complexity of the following program segments(1) x=90; y=100;While (y0)If (x100)x=x-10; y-;Else x+;(2) for (i=0; in; i+);For (j=0; jm; j+)Aij=0;(3) s=0;For i=0; in; i+)For (j=0; jn; j+)S+=Bij;Sum=s;(4) i=1;While (i=n)I=i*3;(5) x=0;For (i=1; in; i+)For (j=1; j1;Y=0;While (x = (y+1) * (y+1)Y+;(1
9、) O (1);(2) O (m*n);(3) O (N2);(4) O (log3n);(5) for x+ were performed n-1+n-2+. N (n-1) /2 1=.So the execution time is O (N2)(6) O ()The second chapter linear table1. choice questions(1) the storage address of the first element of a vector is 100The length of each element is 2The address of the fif
10、th element is ()A.110 B.108 C.100 D.120(2) in the order table of N nodesThe time complexity of the algorithm is O (1), and the operation is ()A. visit the I nodes (1 i n) and the direct precursor of I nodes (2 i n)B. to insert a new node in the I node (1 i n)C. delete the first I node (1 i n)D. n no
11、des from small to large order(3) insert a new element into a sequential table with 127 elements and keep the same orderThe average number of elements to move is ()A.8 B.63.5 C.63 D.7(4) the storage space of the linked storage structure ()A. is divided into two partsPart of the storage node valueAnot
12、her part stores pointers that represent the relation between nodesB. is only part of itStore node valueC. is only part of itA pointer that stores relationships between nodesD. is divided into two partsPart of the storage node valueThe number of units occupied by another part of the node(5) if the li
13、near table uses chain memory structureThe address of the available memory cell in memory ()A. must be contiguous B. parts, and addresses must be contiguousC. must be discontinuous. D. can be continuous or discontinuous(6) the linear table L is applicable to the use of chain structures in () casesA.
14、often needs to modify the node value in B., and L needs to delete and insert L constantlyC.L contains a large number of nodes, and the node structure in D.L is complex(7) storage density of single linked list ()A. greater than 1 B. equals 1 C. less than 1 D. cannot be determined(8) merging two ordered tables with n elements into an ordered tableThe minimum number of comparisons is ()A.n B.2n-1 C.2n D.n-1(9) in a sequential table of length nIn the first I elements (1 I n+1) before inserting a new element to move backwards (elements)A.n-i B.n-i+1 C.n-i-1 D.i(10) linear table L= (A1A2. an)The f