Time Complexity---I think about the face of junior maths teacher again xxxxx

Source: Internet
Author: User

Time complexity:---my head is big, my foot hurts.

Common time complexities are: constant, number, linear, linear, square, cubic, polynomial, exponential, and factorial levels.

Here we mainly discuss the number of levels, linear level, square level, point of magnitude---why not discuss other? I can't do anything else,---.

Linear level:

F (x) Εo (n*n): This means that the growth rate of this function will not be n*n in the future. The x here refers to a specific input.

Use N to estimate the range size of X

Let's write a piece of code first. Qaq:

Def EXP1 (A, B):    ans =1 while    (b>0):        ans *=a        b-=1    return ans

This method is to find the value of the B-side of a? So how many times did b=10 do it, 3b+2 that's 32 times, then we can draw

F (x) Εo (3b+2) But 2 does not seem to change, when the value is larger 2 is not meaning so f (x) Εo (3b) Of course he is linear we all write wrong O (n)

To be continued ——————————————————————————————

Time Complexity---I think about the face of junior maths teacher again xxxxx

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.