First, the basic concept
data
Value Description objective things, a set of characters and various symbols can be input into the computer and can be processed , i.e., data of objective things can be identified using a computer, stored and processed for the description of
Data Elements
Composition data basic unit
Data entry is an integral dataThe smallest unit
Data Objects
The same natureA set of data elements
type of data
- The same properties as a set of values, and the general term for a set of operations defined in this set of values
- Data types define two sets, i.e., the type of the value range and the type may allow the use of a set of operation
- Objective: To achieve information hiding, users do not have the details of the package
- Classification ( "value"):
category | Can break down |
---|---|
Structure type (non-component structure can also be a structure, such as arrays, structures | By a number of ingredients in a certain structure. Decomposable |
Unstructured atom type (standard C language type (integer, real, string, etc.) and a pointer | Value Indecomposable |
Abstract data types and data abstraction
Abstract data type (ADT) reprint blog
Three implementation
- The traditional process-oriented program design
- "Package" "model" design method
- Object-oriented programming
Second, the data structure
Content data structure can be grouped into three parts:
- Logical structure;
- Storage structure;
- Set operation;
Any algorithm design depends on the selected data ( logical ) configuration, and the algorithm implemented depends on the use of storage configuration
data structure
Defined
the presence of one or more specific one anotherrelationshipThe collection of data elements;
[Note]
data structure is aTuple: Data_Structure = (D, R)
wherein, D means a finite set of data elements, R is the relationship between the finite set of D
Logical structures (abstract data structures)
Between data elementsrelationshipdescription of
Four basic structure
basic structure | relationship |
---|---|
Collection structure | Belong to a collection |
Linear structure | One linear relationship |
Tree structure | Level-many relationship |
FIG structure | Any many relationship |
Storage structure (data structure implemented)
Data elements with a number of computer == binary "bit string" indicates ==
The relationship between the data elements in the computer representation
- Sequentially stores:
by means of the elements represent logical relationships between data elements in the relative position memory - Chain stores:
by means of the pointer indicates the logical relationships between data elements
Classification data structure
The data elements between the relationship
- Linear structure(Linear table, stack, queue, strings, arrays, generalized table)
- Nonlinear structure(Tree diagram)