data structure
Data structure is the way that computers store and organize data. A data structure refers to a collection of data elements that have one or more specific relationships with each other. Generally, a well-chosen data structure can lead to higher operation or storage efficiency. Data structure is usually related to effective retrieval algorithm and indexing technology.
I. Definition of nouns
Data structure refers to the collection of data elements with one or more relationships with each other and the relationships among data elements in the collection. Remember as follows:
1. data structure =(D, r)
2. where d is a group of data elements and r is a finite set of relationships among all elements in the group.
Other definitions
1. Sartaj Sahni said in his book "Data Structure, Algorithms and Applications": "A data structure is a data object, and all kinds of connections between the instances of the object and the data elements that make up the instances. These relationships can be given by defining related functions. " He defined a data object as "a data object is a collection of instances or values".
2.Clifford A.Shaffer's definition in the book Data Structure and Algorithm Analysis is: "Data structure is the physical realization of ADT (abstract data type)."
3. In the book Data Structure and Programming, Robert L. Kruse divides the design process of data structure into abstract? Layer, data structure layer and implementation layer. Among them, the abstract layer refers to the abstract data type layer, which discusses the logical structure of data and its operation, while the data structure layer and the implementation layer discuss the representation of a data structure, the storage details in the computer and the implementation of the operation.
4. Data structure specifically refers to the relationship between elements in the same kind of data elements, including three components, the logic of data? Series structure, data storage structure and data operation structure.
Second, the significance
Generally speaking, data structure is organized by data elements according to some logical connection. The description of the logical relationship between data elements is called the logical structure of data; Data must be stored in the computer, and the storage structure of data is the data structure and its expression in the computer; In addition, it is meaningful to discuss the data structure and the operations performed on this data at the same time. A logical data structure can have multiple storage structures, which affect the efficiency of data processing.
In many types of programming, the choice of data structure is a basic design consideration. The construction experience of many large-scale systems shows that the difficulty of system realization and the quality of system construction largely depend on whether the optimal data structure is selected. Many times, after the data structure is determined, the algorithm is easy to get. Sometimes things will be reversed, and we choose the data structure according to a specific algorithm to adapt. In either case, it is very important to choose an appropriate data structure.
When the data structure is selected, the algorithm is determined. The key factor of system construction is data rather than algorithm. This insight has led to the emergence of many software design methods and programming languages, and object-oriented programming language is one of them.
Third, the research content
In computer science, data structure is a subject that studies the operating objects (data elements) of computers and their relations and operations in non-numerical computing programming problems, and ensures that the new structure obtained after these operations is still the original structure type.
As an independent course, "Data Structure" was established from 1968 abroad. From 65438 to 0968, Professor Donald Knuth of the United States initiated the initial system of data structure. His book "The Art of Computer Programming" Volume I "Basic Algorithms" is the first book that systematically expounds the logical structure, storage structure and operation of data. Data Structure is a comprehensive basic course for computer majors, and data structure is a core course between mathematics, computer hardware and computer software. The content of data structure is not only the basis of general programming (especially non-numerical programming), but also an important basis for designing and implementing compiler, operating system, database system and other system programs.
Computer science is a science that uses computers to study information representation and processing. There are two problems involved here: information representation and information processing.
The representation and organization of information is directly related to the efficiency of information processing program. With the popularization of computers, the increase of information and the expansion of information scope, many system programs and applications are large in scale and quite complex in structure. Therefore, in order to write a "good" program, it is necessary to analyze the characteristics of the objects to be processed and the relationship between them, which is the problem to be studied in the course of data structure. As we all know, computer programs process information. In most cases, this information is not unorganized, and there is often an important structural relationship between information (data), which is the content of data structure. The structure of data directly affects the selection and efficiency of the algorithm.
When a computer solves a specific problem, it generally needs to go through the following steps: first, abstract a suitable mathematical model from the specific problem, then design an algorithm to solve this mathematical model, and finally write a program, test and adjust it until the final solution is obtained.
The essence of solving mathematical model is to analyze the problem, extract the operational objects from it, find out the relationship between these operational objects, and then describe them in mathematical language. When people use computers to deal with numerical calculation problems, the mathematical models used are described by mathematical equations. The operation objects involved are generally simple, plastic, real and logical data, so the programmer's main focus is on programming skills, rather than data storage and organization. The more fields of computer application are "non-numerical calculation problems", and its mathematical model can not be described by mathematical equations, but only by data structures. The key to solve this kind of problem is to design an appropriate data structure, and the mathematical model describing non-numerical problems is described by linear tables, trees, graphs and other structures.
Computer algorithms are closely related to the data structure. All algorithms are attached to a specific data structure, and the data structure is directly related to the selection and efficiency of algorithms. The operation is completed by the computer, and the corresponding insertion, deletion and modification algorithms need to be designed. In other words, the data structure also needs to give the algorithms of various operations defined by each structure type.
Data is the carrier of information and the general name of information symbols that can be recognized, stored and processed by computers to describe objective things. The set of all symbols that can be input into a computer and processed by the computer is the object of computer program processing. Objective things include numerical values, characters, sounds, graphics, images and so on. They are not data in themselves, but only after they are encoded into symbolic forms that can be recognized, stored and processed by computers.
Data element is the basic unit of data, which is usually considered as a whole in computer programs. A data element consists of several data items. A data item is the smallest unit of discussion in a data structure. There are two types of data elements: if data elements can be subdivided, then each independent processing unit is a data item, and a data element is a collection of data items; If data elements are inseparable, data elements and data items are the same concept, such as the integer "5" and the character "n". For example, a data element describing student information can be composed of the following six data items. Among them, the date of birth can be composed of three data items: year, month and day. As a combined item, it is called the date of birth, and the other inseparable data items are atomic items.
A keyword refers to a data item that can identify one or more data elements. If it can play a unique recognition role, it is called a "first-class" keyword, otherwise it is called a "second-class" keyword.
A data object is a collection of data elements and data subsets with the same properties. Data objects can be finite or infinite.
Data processing refers to the operation process of finding, inserting, deleting, merging, sorting, counting and simple calculation of data. In the early days, computers were mainly used for scientific and engineering calculations. After the 1980s, computers were mainly used for data processing. According to relevant statistics, the time proportion of computers used for data processing has reached more than 80%. With the passage of time and the further popularization of computer applications, the proportion of time that computers spend on data processing will surely increase further.