An overview of the "Li Muhua" algorithm and data structure

Source: Internet
Author: User
Tags abstract data structures

"Turn from" http://blog.csdn.net/Alfa_/article/details/53735814
Principles of data structure and algorithm overview data structure
A kind of data structure is the representation of a class of information and its related operation an algorithm is called effective if it can solve the problem within the required resource constraints. A resource limit is the amount of space that can be used to store data--which can be divided into memory space limits and disk (external memory) space limits--and the time that is required to allow each subtask to be executed.

Abstract data types and data structure types are collections of a set of values. A data item is a piece of information or a record whose value belongs to a type, and a data item can also be said to be a member of a data type. Data items can also be said to be members of data structures. A data type refers to a type and a set of operations defined on that type. Abstract data type (ADT) refers to a data structure as an implementation of a software composition. Data structures are implementations of abstract data types (ADT). Data items have a logical form (Logical form) and physical form (physical form) two aspects. The data item defined by the abstract data type (ADT) is its logical form, and the realization of the data item in the structure is its physical form.

Problems, algorithms, and procedural problems: from a mathematical point of view, you can think of a problem as a function. A function is a mapping between an input (that is, domain defined) and an output (that is, a range of ranges). Algorithm: Refers to a method or a process of solving a problem.
Nature: Correctness: Includes validity (soundness) and completeness (completeness). It must complete the required functions and convert each input into the correct output. Specific steps: An algorithm should consist of a series of concrete steps. Determinism: The next steps that should be performed must be clear. Limited: An algorithm must consist of a finite number of steps. Can terminate the line: The algorithm must be able to terminate, that is, cannot enter the dead loop. Program: A computer program is considered to be a specific implementation of an algorithm using a programming language. Summary: The problem is a function, or a mapping from input to output. The algorithm is an approach that solves the problem and has specific steps. Algorithm Analysis Overview

A basic consideration in judging the performance of an algorithm is the number of "basic operations" that the algorithm needs to perform when processing a certain "scale" input. "Size" generally refers to the number of inputs. A "basic operation" must have this nature: the time required to complete the operation is independent of the specific value of the operand.
The rate of growth of an algorithm is the rate at which the cost of the algorithm increases when the value of the input is increased.
best, worst, and average conditions

For some algorithms, even if the problem is the same size, the time overhead is different if the input data is different.
Asymptotic Analysis

Upper limit (minimum upper limit): "The growth rate of the line for F (n)" becomes the large O notation (big oh notation), read as "the large European" notation. If an algorithm's growth rate is on-line (in the worst case) f (n), then the algorithm is said to be "worst-case in the Set O (f (n))", or directly "worst case in O (f (n))".
Lower limit (maximum lower limit): the lower limit of the algorithm is denoted by the symbol Ω and read as "Big Omega". If there are two normal numbers C and n0, for n> n0, there is t (n) ≥CG (n), then T (n) in the set Ω (g (n)).
Θ notation: If an algorithm is in both O (H (n)) and Ω (H (n)), it is called θ (h (n)).
clear:

The best, worst, or average situation gives a clear example that can be applied to the problem to get a measure of the cost. The upper and lower limits describe the rate at which this price is increased. So when defining the growth rate of an algorithm or problem, you need to determine the metrics (best, worst, average) and describe the cost growth rate (o,ω,θ). estimation of time complexity

For the general algorithm, we can look at the for loop to do a simple multiplication, calculate the number of cycles can be. For the more complicated problems, we need a little mathematics knowledge, probability theory knowledge to assist the analysis.


Copyright©by Li Muhua
Judge by Cold River Snow
date:2016.12.20

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.