Вы находитесь на странице: 1из 5

9/20/2015

Asymptotic Notation | Asymptotic Notation in Data Structure FreeFeast.info : Interview Questions ,Awesome Gadgets,Personality Motivation Guide, F

We Are Hiring

Awesome Gadgets

Difference Between

Personality Motivation

Quiz

IT Stuff

Tutorials

Home IT Stuff Asymptotic Notation | Asymptotic Notation in Data Structure

Asymptotic Notation |
Asymptotic Notation in
Data Structure
Poonam Dhanvani

February 17, 2013

Search

Advertisement

IT Stuff

freefeast.info
6,311 likes

Asymptotic Notation
Asymptotic notation is a way of expressing the cost of an

Like Page
Be the first of your friends to like this

algorithm. Goal of Asymptotic notation is to simplify Analysis by


getting rid of unneeded information
Following are the asymptotic notation:
BigOh Notation (O) :
>> O(g(n)) = { f(n) : there exist positive constants c and n0 such that 0 <

Test Your Knowledge

f(n) < c*g(n) for all n > n0 }.


>> It is asymptotic upper bound.
>>The function f(n) = O(g(n)) iff there exist positive constants c and n0 such
that f(n) c * g(n) for all n, n n0.

http://freefeast.info/general-it-articles/asymptotic-notation-asymptotic-notation-in-data-structure/

1/5

9/20/2015

Asymptotic Notation | Asymptotic Notation in Data Structure FreeFeast.info : Interview Questions ,Awesome Gadgets,Personality Motivation Guide, F

>> The statement f(n) = O(g(n)) states only that g(n) is an upper bound on
the value of f(n) for all n, n no.
>> Eg :
1. 3n + 2 = O(n)
3n + 2 4n for all n 2.
2. 3n + 3 = O(n)
3n + 3 4n for all n 3.
3. 100n + 6 = O(n)
100n + 6 101n for all n 6.

Omega Notation ()
>> (g (n)) = { f(n) : there exist positive constants c and n0 such that 0
< c * g(n) < f(n) for all n > n0 }
>> Asymptotic lower bound.
>> The function f(n) = (g(n)) iff there exist positive constants c and n0
such that f(n) c * g(n) for all n, n n0.
>> The statement f(n) = (g(n)) states only that g(n) is only a lower bound
on the value of f(n) for all n, n no.

http://freefeast.info/general-it-articles/asymptotic-notation-asymptotic-notation-in-data-structure/

2/5

9/20/2015

Asymptotic Notation | Asymptotic Notation in Data Structure FreeFeast.info : Interview Questions ,Awesome Gadgets,Personality Motivation Guide, F

>> E.g.
1. 3n + 2 = (n)
3n + 2 3n for all n 1.
2. 3n + 3 = (n)
3n + 3 3n for all n 1.
3. 100n + 6 = (n)
100n + 6 100n for all n 0.

Theta Notation ()
>> (g(n)) = { f(n) : there exist positive constants c1 and c2 and n0 such
that 0 < c1 * g(n) < f(n) < c2 * g(n) for all n > n0 }
>> The function f(n) = (g(n)) iff there exist positive constants C1, C2 and
n0 such that C1 * g(n) f(n) C2 * g(n) for all n, n n0.
>> E.g.
1. 3n + 2 = (n)
3n + 2 3n for all n 2.
3n + 2 4n for all n 2.
So, C1 = 3, C2 =4 & n0 =2.
>> The statement f(n) = (g(n)) iff g(n) is both an upper and lower bound
on the value of f(n).
http://freefeast.info/general-it-articles/asymptotic-notation-asymptotic-notation-in-data-structure/

3/5

9/20/2015

Asymptotic Notation | Asymptotic Notation in Data Structure FreeFeast.info : Interview Questions ,Awesome Gadgets,Personality Motivation Guide, F

Little oh Notation (o)


>> o(g(n)) = { f(n) : for any positive constant c>0 , there exists a constant n0
such that 0 < f(n) < c * g(n) for all n > n0 }
>> We use o notation to denote an upper bound that is not asymptotically
tight.
>> The definitions of O-notation and o-notation are similar. The main
difference is that in f(n) =O(g(n)), the bound 0 < f(n) < c*g(n) holds for some
constant c>0 but in f(n) =O(g(n)), the bound 0 < f(n) < c *g(n) holds for all
constants c > 0.

Little omega Notation (w)


>> w(g(n)) = { f(n) : for any positive constant c>0 , there exists a constant n0
such that 0 < c * g (n) < f(n) for all n > n0 }

>> We use w notation to denote an lower bound that is not asymptotically


tight.

http://freefeast.info/general-it-articles/asymptotic-notation-asymptotic-notation-in-data-structure/

4/5

9/20/2015

Asymptotic Notation | Asymptotic Notation in Data Structure FreeFeast.info : Interview Questions ,Awesome Gadgets,Personality Motivation Guide, F

Related Post

Insertion Sort |
Pseudo Code of
Insertion Sort | I...

What is an
algorithm? | Define
algorithm |
Explain...

Difference between
Calloc and Malloc |
Calloc() vs...

Difference between
Tree and Binary Tree
| General ...

Algorithm Analysis, Asymptotic Notation, Asymptotic Notation in Data Structure,


BigOh Notation (O), Data Structure, Little oh Notation (o), Little omega Notation
(w), Lower Bound, Notations, Omega Notation (), Positive Constants, Theta
Notation (), Upper Bound

About Poonam Dhanvani


Assistant Professor in Master of Computer Application (MCA)
View all posts by Poonam Dhanvani

Selection Sort | Pseudo Code of

Merge Sort | Pseudo Code of Merge

Selection Sort | Selection Sort in

Sort | Merge Sort in Data Structure

Data Structure

| Divide and Conquer Approach

Copyright 2015. FreeFeast.info : Interview Questions


,Awesome Gadgets,Personality Motivation Guide,
Famous IT personalities

http://freefeast.info/general-it-articles/asymptotic-notation-asymptotic-notation-in-data-structure/

5/5

Вам также может понравиться