2. The large o symbol in the algorithm

Source: Internet
Author: User

The large o symbol is a relative representation of the complexity of the algorithm.

1. Large o represents the operand of the algorithm, indicating how quickly the algorithm runs

2. The large O notation indicates the worst-case run time, such as the Run Time O (n) of a simple lookup, meaning that in the worst case, it must be run N times to find the result. O (n) is a guarantee of the algorithm-----run time cannot exceed O (n)

3. Common some big O run-time

    • O (Logn) logarithmic time. The algorithm for this Yang includes two-point search
    • O (n) linear time, such an algorithm includes a simple lookup
    • Algorithms such as O (N*LOGN) include fast sorting
    • O (n2) Algorithms include selection sequencing-a slower sorting algorithm
    • O (n!) a very slow sorting algorithm (the solution to the problem of the traveling business)

4. The speed of the algorithm refers not to the time, which is the growth rate of the operand

2. The large o symbol in the algorithm

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.