Progressive notation of Computer Algorithm Analysis

Source: Internet
Author: User
Preface

When learning computer algorithms, I know that the time complexity of insertion sorting is O (n2). What does OSN mean? This article describes the tags used in algorithm analysis.

Odo

Definition: O (g (n) = {f (n ):Normal countC and n0, so that all n> = n0 has 0 <= f (n) <= cg (n )}. The Odo number indicates the progressive upper bound of the function.

Can be expressed as f (n) = O (n2 ). Proof:

To make 0 <= f (n) <= cg (n)

The existence of c = 9/2, n0 = 1, so that all n> = n0 has 0 <= f (n) <= cg (n ).

O (g (n) and the mark mentioned later represent a set, while f (n) = O (n2) actually means f (n) ε O (n2 ).

Assume that,

Then g (n) = O (n2), f (n) = O (n2)

Large Ω mark

Definition: Ω (g (n) = {f (n ):Normal countC and n0, so that all n> = n0 has 0 <= cg (n) <= f (n )}. The greater Ω mark indicates the progressive lower bound of the function.

Assume that,

Then g (n) = Ω (n), f (n) = Ω (n)

Mark

Definition: Random (g (n) = {f (n ):Normal countC1, c2, and n0 enable 0 <= c1g (n) <= f (n) <= c2g (n)} For all n> = n0 )}. The greater limit mark indicates the progressive confirmation of the function.

Assume that,

Then g (n) = random (n), f (n) = random (n2)

OSS note

Definition: o (g (n) = {f (n): pairArbitrary normal countC. If n0 exists, 0 <= f (n) <= cg (n)} exists for all n> = n0 )}. The Odo number indicates the upper bound of the non-progressive closeness of the function.

Assume that,

Then g (n) = o (n2), f (n) O (n2)

Small mark

Definition: (g (n) = {f (n): pairArbitrary normal countC. If n0 exists, 0 <= cg (n) <= f (n)} exists for all n> = n0 )}. The lower Mark gives the lower bound of the non-progressive closeness of the function.

Assume that,

Then g (n), f (n) = (n)

Summary

Not all functions can be incrementally compared. If the limit value does not exist (not equal to 0, constants, and infinity ). For example

The limit does not exist and is not equal to infinity.

Related Article

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.