Basic concepts of data structure:
(1) Research object of data structure
The data structure is a science that discusses how to represent and implement the mathematical model (non-numerical computation) of real-world entities and how they operate in computers. The content of the data structure includes three "layers" of five "elements".
| hierarchy \ Features |
Data Representation |
Data Processing |
| Abstract |
Logical Structure |
Basic operations |
| Realize |
Storage structure |
Algorithm |
| Evaluation |
Analysis of comparison calculation method for different data structures |
|
(2) Basic concepts and terminology
Simply put, the data is the general name of the object of computer operation. The data element is the basic unit of data, and he is an individual in the data. A data object is a collection of elements of the same nature and is a subset of the data.
Data structure refers to the existence of one or more of the same characteristics of a collection of elements of the same. There are three elements: d,s,p
The logical structure of the data is a description of the logical relationship between the data elements, which is a collection knot, a linear structure, a tree structure and a graphical structure.
The data storage structure is the representation and implementation of the logical structure in the computer, with sequential memory, chained storage, index storage, and hash storage.
(3) data types and abstract data types
A data type is a collection of values and a generic term that defines a set of operations on this collection.
Abstract data types refer to a mathematical model and a set of operations on this mathematical model. Abstract data types and data types are essentially a concept, but the scope of the abstract data type is broader and you can define your own data types.
(4) Algorithm and algorithm analysis
The algorithm is a description of the steps to solve the pending problem and is a finite sequence of instructions. An algorithm must satisfy five characteristics: poor, feasible, deterministic, input, and output.
The algorithm and the program are different concepts, the program does not necessarily satisfy the poor nature, the instruction in the program must be the machine executable, an algorithm if uses the programming language description, it is a program.
"Good algorithms" must consider goals: correctness, readability, robustness, efficiency, and low storage.
There are usually two ways to measure the efficiency of an algorithm:
1, post-mortem statistics (easy to cover up the merits of the algorithm itself)
2. Pre-analysis and estimation method (focusing on strategy and scale)
The algorithm's progressive time complexity is recorded as: T (n) =o (f (n))
Space complexity: S (n) =o (g (n)), if the required additional space relative to the input data amount is a constant, it is said that the algorithm is in-situ operation.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Basic concepts of data structure