Growth of Functions Flashcards

1
Q

An algorithm that is asymptotically efficient is best choice for all inputs?

A

No, for small inputs the asymptotic efficeiency is not helpful. for small inputs insertion sort o(n^ 2) is faster than merge sort n(logn)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what are all the notation used to describe asympototic?

A

Big-O Notation (O),Omega Notation (Ω),Theta Notation (Θ),Little-o Notation (o),Little-Omega Notation (ω)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Big-O notation

A

Big-O notation describes the upper bound of an algorithm’s growth rate. It gives the worst-case time or space complexity.

Mathematical Representation:
f(n)=O(g(n)) if there exist constants
c>0 and 𝑛0≥0
such that:

f(n)≤c⋅g(n),foralln≥n0

.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Omega Notation (Ω)

A

Omega notation describes the lower bound of an algorithm’s growth rate. It gives the best-case time or space complexity.

Mathematical Representation:
f(n)=Ω(g(n)) if there exist constants
c>0 and 𝑛0≥0
such that:

f(n) ≥ c⋅g(n),foralln≥n0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Theta Notation (Θ)

A

Theta notation describes the tight bound of an algorithm’s growth rate. It bounds the algorithm from above and below, describing its exact asymptotic behavior.

Mathematical Representation:
f(n)=Θ(g(n)) if there exist constants
c1,c2>0 and n0≥0

c 1. g(n)≤f(n)≤c2 ⋅g(n),
foralln≥n 0

.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Can we use all notation to specify running times?

A

Yes, but we need to mention precisely is good practice. for example we can say worst case running time of insertion sort in Big O(n^2), Omega(n^2),Theta(n^2), but Theta is most suited since running time is tightly bounded

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Little O

A

it refer to running is stricly lower than inputs. Bigoh means is equal to or slower.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

ω (Little-Omega)

A

strictyl faster than inputs,
Big omega is atleast it will run for the inputs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly