Algorithm of data structure

Source: Internet
Author: User

Algorithm

  algorithm -- A description of the solution steps for a particular problem

  Features: input--0 or more inputs

Output--1 or more outputs

      have poor sex

Certainty

Feasibility

How to evaluate an algorithm for good or bad?

      The right

High readability

High time efficiency

Small storage space

Time complexity of the algorithm

At the time of the algorithm analysis, the total number of executions of the statement T (N) is a function of the problem size n, which then analyzes the change of T (n) with N and determines the order of magnitude of T (N). The time complexity of the algorithm, which is the time measurement of the algorithm, is recorded as: T (n) = O (f (n)).

It indicates that with the increase of the problem size n, the growth rate of the algorithm execution time is the same as the growth rate of f (n), which is called the asymptotic time complexity of the algorithm, referred to as the time complexity . where f (n) is a function of the problem size n.

Derivation of the large O-order method

1.

Replaces all the addition constants in the run time with constants.

2.

In the modified run Count function, only the highest order is preserved.

3.

If the highest order exists and is not, the constant multiplied by the item is removed. The result is the Big O-order.

Common time complexities such as tables:

      

Algorithm of data structure

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.