Analysis of Algorithms Flashcards

1
Q

How do you work out the time for an algorithm to be executed?

A

T(n) = C op x C(n)

Where C op is the time to execute the basic operation on a computer, and C(n) is the number of times it needs to be executed.

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

Big O notation definition

A

A function t(n) is said to be in the O(g(n)) denoted by t(n) = O(g(n)) if there exists some positive constant c and some nonnegative integer n0 such that:

t(n) <= cg(n), n>= n0.

lecture 5 if you dont understand

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

Small o notation definition

A

Strict upper bound.

A function t(n) is said to be in the o(g(n)) denoted by t(n) = o(g(n)) if there exists some positive constant c and some nonnegative integer n0 such that:
t(n) < cg(n), n >= n0. Not equal to.

Example g(n) = o(n^2), g(n) CANNOT be quadratic

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

Omega notation Ω

A

A function t(n) is said to be in the Ω(g(n)) denoted by t(n) = Ω(g(n)) if there exists some positive constant c and some nonnegative integer n0 such that:

t(n) >= cg(n), n >= n0, greater

Big Omega is inverse of Big O

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

Theta notation θ

A

A function t(n) is said to be in the θ(g(n)) denoted by t(n) = θ(g(n)) if there exists some positive constant c1 and c2 and some nonnegative integer n0 such that:

c1 g(n) <= t(n) <= c2 g(n), n > n0

you do t(n) = 0(g(n)) and t(n) = Ω(g(n))

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

log b x = ?

A

log b x = ( log a x ) / ( log a b)

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

c = O(?)

A

c = O(1) for any constant c

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