Respecting original----and the original link -- infringement deletion
Do you remember this classic formula? program = data structure + algorithm the importance of visible data structures and algorithms for programs.
I. Basic concepts of data structures
data structure definition :
A data structure is a way to store and organize your information for easy access and modification. The data structure includes the logical Structure , the storage structure of the data and the operation of the data, that is, a batch of data organized according to some kind of logical relation, which is stored in the memory of the computer according to certain mapping method. and defines a set of operations on these data.
- logical Structure of data : reflects the relationship between data elements. There are set, linear structure, tree structure, and graph structure.
- the storage structure of the data: the storage image of the logical structure in the computer is the realization of the logical structure in the computer, which includes the representation of the data element and the representation of the relationship between the elements. There are sequential storage structures (arrays), chained storage structures (linked lists), index storage structures, hash storage structures, and so on.
- Operation of data : Manipulation of data, described by algorithm.
Two. Basic concepts of the algorithm
Algorithm definition :
A series of steps required by a computer to solve a problem
Basic features of the algorithm :
- input : An algorithm has 0 or more inputs to characterize the initial situation of the operand, so-called 0 input refers to the algorithm itself gives the initial conditions;
- output : An algorithm has one or more outputs to reflect the results of processing the input data. The algorithm without output is meaningless;
- Poor : The algorithm must be able to terminate after a finite number of steps have been performed;
- certainty : Each step of the algorithm must have a definite definition;
- Feasibility : Any calculation step performed in the algorithm can be decomposed into a basic executable step, that is, each calculation step can be completed within a limited time.
Requirements for algorithmic design:
- correctness : The design of the algorithm can meet the needs of specific problems, and any legitimate input will be the correct output;
- readability : Refers to the algorithm is written well, the algorithm to understand the ease of the degree of readability of an algorithm is very important. If an algorithm is abstract and difficult to understand, then this algorithm is not conducive to communication and promotion use, for modification, extension, maintenance is very inconvenient, therefore, in the pursuit of efficiency, but also should be the algorithm as simple as possible to understand.
- robustness : When the input data is illegal, the algorithm will also make a corresponding judgment, but not because of the input errors and caused by paralysis.
- High time efficiency (time complexity) and less storage space (space complexity)
complexity of Time:
The approximate number of executions (not execution time) of the program. In general, the number of iterations of the basic operation of the algorithm is a function of the problem size n, denoted by T (n), if there is an auxiliary function f (n), so that when n approaches infinity, the limit value ofT (n)/f (n) is not equal to zero constant, then f (n) is t (n) The same order of magnitude functions. Memory as T (n) =o (f ( N)), called O (f (n) ) is the progressive time complexity of the algorithm, referred to as time complexity
Complexity of space:
The storage space consumed by the algorithm is also a function of the problem size n. It is a measure of the amount of storage space that is temporarily occupied by an algorithm while it is running. The storage space occupied by an algorithm in the computer memory, including the storage space occupied by the storage algorithm itself, the storage space occupied by the input and output data of the algorithm and the storage space occupied by the algorithm in the running process three aspects.
Mind Mapping:
The next two mind map, in the blog post is not full, download to the local look, will be better
Forget the two mind map from where to get, original blogger, not live, infringement delete
Data structure and Algorithms: Overview + Mind Mapping