Textbook-Extracurricular books recommended
Gao Yifan (pseudo algorithm → true code)
Data Structure Overview
Defined
How do we store large and complex problems in real life in a specific data type and a specific storage structure into the main memory (memory), and on this basis for the implementation of a function (such as finding an element, delete an element, sorting all elements), the corresponding operation is called the algorithm
Data structure = individual + individual relationship
Algorithm = operation on stored data
Algorithm
Methods and steps for solving problems
Criteria for measuring algorithms
1. Complexity of Time
The approximate number of times the program will be executed, not the time it takes to execute
2. Complexity of space
The maximum memory occupied by the algorithm during execution
3. Degree of difficulty
4. Robustness
The status of data structures
Data structure is the core course in software
Program = data storage + data manipulation + languages that can be executed by the computer
Last edited on August 18, 2015, 23:10:06
Pre-knowledge
Pointer
The importance of pointers:
Pointer is the soul of C language
Defined
Address
The address is the number of the memory unit
Non-negative integer starting at 0
Range: 0--ffffffff (0--4g-1)
Pointer:
The pointer is the address, the address is the pointer
A pointer variable is a variable that holds the address of a memory cell
The essence of a pointer is a non-negative integer with restricted operation
Classification:
1. Basic types of pointers
2. Pointer and array relationships
Last edited on August 19, 2015, 23:06:51
Structural body
Why is there a struct
In order to represent some complex data, the common basic type variable does not meet the requirements
What do you mean, structural body
Structs are composite data types that users define themselves according to their needs
How to use the structure body
Two different ways
struct Student st = {, "Zhangsan", 20};
struct Student * PST;
1.
St.sid
2.
Pst->sid
This member of the SID in the struct variable that the PST points to
Precautions
struct variables cannot be subtraction, but can be assigned to each other
Common structure variables and structure pointer variables as function-parameter-transfer problems
Use memory---across functions to implement with dynamic memory allocation
In general, the memory is freed after the custom function ends, and only the dynamically allocated memory does not meet the free function, and the custom function ends, but the memory still exists.
Last edited on August 20, 2015, 23:00:44
Data structure note (Hao Bin presenter) (updated August 21)