0X00 data structure 1. Definition
The data structure is a subject that discusses "how to represent and implement the computational model of real-world entities (usually non-numerical computations) and how they are represented and implemented in computers."
2. Several concepts
- Data: A set of numbers and characters that describe an objective thing;
- Data element: That is, a record, is the basic unit of data;
- Data item: The smallest unit of data that has an independent meaning for a field or domain;
- Data objects: A set of data elements of the same nature, a subset of the data;
- Data structure: The relationship between all of the elements of the element and the data.
My understanding:
3. Scope of study
- Logical Structure of data: the logical relationship between data elements
- Collection
- Linear structure
- Tree-shaped structure
- Graphic structure
- Storage structure of data: how data elements and their relationships are stored in a computer
- Sequential storage structure
- Chained storage structure
- Index storage structure
- Hash (hash) storage structure
- Operation of the data
4. Description: Two tuples
b= (D,r)
where b is a data structure consisting of the set R of the two-tuple relationship on the set D and D of the elements.
0x01 algorithm 1. What is the algorithm?
The algorithm implements an abstract operation on the specific storage structure, which consists of the control structure (order, branch and Loop) and the original operation (the operation of the intrinsic data type, as the basic operation of the algorithm).
The 5 properties of the algorithm:
- have poor sex
- Certainty
- Feasibility
- Have input
- Has output
2. Description of the algorithm
- Language approach
- Graphic mode
- Tabular approach
3. Algorithm Analysis
The goal of the algorithm design
- Correctness
- Usability
- Readability
- Robustness
- High efficiency and low storage requirements
Efficiency analysis of the algorithm
- Post-mortem statistical method
- Pre-analysis and estimation method
Time complexity: The frequency of a statement is the number of times that the statement has been repeatedly executed in the algorithm. The sum of the frequencies of all the statements in the algorithm is recorded as T (N), which is the function of the problem size n of the algorithm, and the time complexity mainly analyses the order of the T (N). The frequency of the basic operation in the algorithm (the statement in the deepest loop) is the same order of magnitude as T (N), so the time complexity of the algorithm is usually analyzed by using the frequency f (n) of the basic operation in the algorithm. Therefore, the time complexity of the algorithm is also recorded as:
T (n) =o (f (n))
- Algorithm storage Space Analysis
Spatial complexity: a measure of the amount of storage space temporarily occupied by an algorithm during operation (auxiliary variables), generally as a function of the problem size n--s (n) =o (g (n)).
0x02 what does the data structure study?
- Logical Structure
- Linear structure (linear table, stack, queue, string, array, generalized table)
- Tree-shaped structure (tree, binary tree)
- Graphic structure (figure)
- Algorithm (recursive, lookup, inner sort, outer sort)
- Storage structure (file)
0x03 How to learn data structure?
- Think more
- More on the machine
What does the data structure study?