foreword: near the end of the recent period, review the data structure, the following problems and answers, most of them from the network, if there is a wrong place also please point out. Here, the Nebula wish you a successful final exam, Happy New Year!
Introduction to the first chapter1. Data structure is a study of non-numerical computing programming problems in the computer ( manipulating objects ) and their ( relationship ) and ( operation ) disciplines. 2. The following basic concepts of data structures are described correctly (C). A. The data element is the smallest unit of data. B. The logical structure of data refers to the logical relationship between data items of data. C. The design of any algorithm depends on the selected logical structure, and the implementation of the algorithm relies on the storage structure adopted. D. The advantage of sequential storage is that the storage density is high, and the insertion and deletion operations are efficient. ---------------------parsing:option A, wrong, because the data item is the smallest unit of data that is not divisible. option B, wrong, in short, a logical structure is a logical relationship between data elements, not a relationship between data items within a data elementoption C, yes, the design of any algorithm depends on the selected logical structure, and the implementation of the algorithm relies on the storage structure adopted. option D, wrong, the first half is correct, but the latter half is wrong, that's the advantage of chained storage. Sequential storage Insert and delete operations are inefficient, inserting and deleting a data element in a sequential table with a table length of N, with an average number of data elements that are moved by half the length of the table.3. "Structure" in "data structure" refers to (D). A. Value of the dataB. Relationships between data items of a data elementC. Composition of the data D. relationships between data elements parsing:The "structure" in "data structure" refers to the relationship between elements. 4. How is the logical structure of the data described?
A: Formal definition of data structure:
Denoted by a two-tuple, denoted by:
Data_structure = (D, S)
Where D is a finite set of data elements (that is, a data object), and S is a limited set of relationships between all the data elements in the object. 5. Logically, the data structure can be divided into (C) two major categories.
A Dynamic structure, static structure
B Sequential structure, chained structure
C Linear structure, nonlinear structure
D Elementary structure, structural type structure parsing: Logically, the data structure can be divided into linear structure and nonlinear structure . 6. Which of the following terms is independent of the storage structure of the data?
A Doubly linked list
B Stack
C Clue Two fork Tree
D Hash table
parsing: The so-called "storage-structure-independent" means that both arrays can be implemented and linked lists can be implemented. In this sense,
Doubly linked lists, hash tables are related to the storage structure, because they all need to use "chained storage"; The clue two fork tree is not a linear structure, but it has the characteristic of linear structure after the clue, and relies on "sequential storage". The stack is independent of the storage structure, because the storage of the stack can be implemented in sequential storage, such as an array, or chained storage. 7. The following data structures, (C) are nonlinear data structures.
A Queue
B Stack
C Two-fork Tree
D String parsing: According to the complexity of the relationship between the data elements, the structure is generally divided into two categories: linear structure and nonlinear structure. a linear structure represents a one-to-one relationship between data elements, which represents a one-to-many or many-to-a relationship between data elements . According to the definition of various structures, the binary tree is a nonlinear structure.
8. The following (A) is an advantage of sequential storage methods.
A High storage density
B Easy Insert Operation
C Easy to delete operations
D Easy exchange of data elements
parsing: The advantages of sequential storage are: Large storage density, high storage space utilization, convenient for random storage.
Because sequential storage can cause a large number of nodes to move when inserting and deleting operations, it is not conducive to the frequent execution of inserts and last operations. The description of Option B and C is wrong. and because sequential storage relies on the physical location of elements to reflect the logical relationship between elements, it is difficult to store data in some logical structures more complex. in summary, option A is the correct answer. 9. How are abstract data types described? A : abstract data types can be represented by triples (D,S,P), where D is the data object, S is the set of relationships on D, and P is the basic set of operations on D.
ADT abstract data type name {
Data objects: Definition of Data Objects
Data relationship: definition of data relationship
Basic operation: definition of basic operation
} ADT abstract Data type name
10. An algorithm should be (B).
A Program
B Description of the problem solving step
C To meet five basic features
D A and C.
parsing:The algorithm is a description of the specific problem solving step, it has five important features: 1. Poor sex 2. Certainty 3. Feasibility 4. Input 5. Output 11. The time complexity of an algorithm is O (N2), indicating that the algorithm (C)
A problem size is N2
B Execution Time equals N2
C execution time is proportional to N2
D problem scale is proportional to N2 parsing:The time complexity is O (N2), which illustrates the algorithm's execution time t (n) <=c * N2 (c is the proportional constant),that is, T (n) =o (N2), time complexity t (n) is a function of problem size n, and its problem size is still n rather than N2.
Data Structure Final Review chapter I introduction