Mu class (Chapter I)

1. What is a data structure?
Data structure (data structure) is a collection of data elements with the structural characteristics, it was the study of the logical and physical structure of the data and the relationships between them, and this arrangement defines the operation to adapt the design the corresponding algorithm, and to ensure that the new structure obtained through these operations after the remains of the original structure type. In short, the data structure is the presence of one or more data elements of the particular relationship between each set, i.e., set with "structure" of the data element. "Structure" refers to the relationship between data elements, and the storage structure into a logical structure.
Logical and physical structure of the data is closely related to two aspects of the data structure, the same logical structure may correspond to different storage structures. Depending on the logic design of the algorithm configuration data, and the algorithm depends on the specified storage structure.
Research data structure is the basis for construction of complex software systems, its core technology is the decomposition and abstraction. By decomposition can be divided into three levels of data; and through the abstract, the specific content of the discarded data elements, the logical structure is obtained. Similarly, by the decomposition processing is divided into various functional requirements, implementation details and then discarded by the abstract, the definition operations is obtained. Binding the two problems can be converted into a data structure. This is from a specific (i.e., specific problems) to the abstract (i.e., data structures) of the process. Then, the storage structure and further achieved by increasing the operational consideration of implementation details such design task. This is an abstract from (i.e., data structures) to a specific (i.e., specific implementation) process.

Subjects:
refers to a data structure reflecting the logical relationships between data elements, wherein the logic means between before and after the relationship between the data elements, regardless of their location stored in a computer. Logical structure comprising:
1. set: In addition to "belong to a set of" outside the relationship, no other relationships between elements in a data structure;
2 linear structure: to-one correlation between the data structure elements;
3 . tree structure: there is a correlation in many of the elements of the data structure;
4. graphical structure: There is many to many relationship between elements in a data structure.

2. What is an algorithm?
Algorithm (Algorithm) refers to the exact problem-solving solutions and complete description, is a series of clear instructions to solve the problem, the algorithm represents a policy mechanism to solve the problem described in a systematic way. That is, a certain specification can be input to obtain the required output within a limited time. If an algorithm is defective, or not suitable for a problem, the implementation of this algorithm will not solve the problem. Different algorithms might use a different time, space or efficiency to accomplish the same task. The pros and cons of an algorithm can use the space complexity and time complexity of the measure.
Algorithm is a calculation instruction is described, when it is running from an initial state and a (possibly empty) an initial input start, through a series of limited and clearly defined state, and stops the output to eventually produce a final state. A state transition to another state is not necessarily determined. Randomized algorithms, including some algorithms, contains some random input.
Formal conceptual aspects algorithm determined from an attempt to solve the problem raised by Hilbert, and thereafter attempt to define effective or efficient computation of the molding process. These attempts include λ calculus Kurt Godel, Jacques Herbrand and Stephen Cole Kleene respectively in 1930, 1934 and 1935 proposed a recursive function, proposed by Alonzo Church in 1936, in 1936 Emil Leon Post in Formulation 1 and Alan Turing in 1937 proposed the Turing machine. Even in the current, still often intuitive idea is difficult to define the situation as a formal algorithm.

Characterized Algorithm:
finite exemplary
algorithm finite refers to the termination of the algorithm must be executed after a finite number of steps;
exact nature
of each step of the algorithm must have a precise definition;
entry
an algorithm has zero or more inputs, in the case of an initial characterization of operands, so-called 0 refers to input the initial conditions of the algorithm itself fix;
output terms
of an algorithm or has a plurality of outputs, to reflect the results of processing the input data. Algorithm does not output is meaningless;
feasibility of
any calculations are performed in step algorithm can be decomposed into basic steps executable, i.e. each calculation step can be completed within a limited time (also referred to as effectiveness).

Elements algorithm:
data objects and arithmetic operation: The basic operation of the computer can execute instructions in the form described. The set of all instructions executed by a computer system to become the computer system instruction. The basic operation of a computer and has the following four operations:
1. arithmetic operations: addition, subtraction and other arithmetic
2. Logical operation: or, and, other non-operational
3. Relationship operations: greater than, less than, equal to, not equal to other operations
4 data transmission: input, output, and other assignment calculation
Second, the control algorithm structure: a functional structure of the algorithm depends not only on the choice of operations, but also on the order of execution between operations.

Problem: The maximum sub-columns, and
personally think that this problem is quite simple, a bit like a caterpillar algorithm, it is a plus to start from scratch,
and then save up the value comparison, if the current value is a negative number, the current value will be cleared so to complete the entire array on OK.

发布了13 篇原创文章 · 获赞 0 · 访问量 351

Guess you like

Origin blog.csdn.net/JSUChengyuezhen/article/details/104344250