I. Introduction
1, the data structure (Data structure) is a computer data storage and data organization manner; refers to a set of mutually presence of one or more data of a particular relationship between the organization and the way they are stored in the computer, and are defined in a set of operations on the set of data.
2, the computer steps to solve the problem
Mathematical model - "Design Algorithm -" programming algorithm
3, the logical structure of the data refers to the data organization and data.
4, the physical structure (Physical Structure) / storage structure means that the data structure in the machine, said logical structure data in the computer implemented.
5, relational data structures, algorithms and program algorithm + Data Structures = Programs (1976 Swiss computer scientist Niklaus Wirth [Niklaus Wirth] proposed)
Second, the basic concepts and terminology
Data (Data): the set of all symbols that can be processed by a computer; data practical problem referred to as original data
Data element (the Data the Element) : this is a collection of individual data, i.e., the basic unit of data.
The data item (Data Item): the data element is often further divided into a number of data items, the data item is the minimum unit having a meaning; and in the database, and the data items called fields / domain. It is indivisible minimum data unit identifier
Type logical structure
- Set: no neighbor relationship between any two nodes, the loose organization.
- Linear structure: nodes arranged in order to logically form a "chain", sequentially one by one between adjacent nodes.
- Tree: branches having, gradation characteristic, the upper and lower layers of the plurality of nodes may be adjacent nodes, but only the lower node and a node adjacent to the upper layer.
- FIG structure: the most complex, any two adjacent nodes can
Data storage structure: representation of the data in the computer.
The main part of the storage structure:
- Storage node (storage node each storing a data element) indicates the data elements between an associated manner.
- Stored in the storage element storing a logical relationship between a data structure of data elements + =.
4 kinds of storage structure
- Sequential storage
- Chain storage
- Index storage
- Hash storage
*********************** sequential structure ************************
- Sequential storage: a storage by means of the relative position of the data elements to represent the logical structure of the data;
- Linear sequential storage tables: a node table is stored in a computer memory a set of contiguous memory cells.
- Method order: store elements to a contiguous storage area.
Features: preallocated length, estimated required amount of memory required for storing data; insertion and deletion of other elements to be moved; fast access is a random access structure.
************************ chain structure *********************** *
- Chain storage: address data element by means of a pointer indicates the logical structure of the data
- This structure is attached to a node pointer field indicating the position of its successor nodes, i.e. the node storage locations are divided into two parts: data item pointer entry
Features: dynamic allocation, memory allocation need not be predetermined; necessary to move the insertion and deletion of other elements; non-random access structure
************************ index storage: ************************************************************ ***
Storage index: index means the index table indicating a storage location of each storage node.
*********************** hash Storage: ************************************************************ ******
Hash storage: indicating the storage location of each node with a hash function.