SCC121: weeks 11-15 Flashcards

(9 cards)

1
Q

how does input size to and algorithm affect time complexity of a constant algorithm?

A

-it doesn’t
-best case, worst case and average case remain the same

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

for a linear algorithm, how do we calculate the time complexity?

A

-directly proportional to input size

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

for a logarithmic algorithm, how do we calculate the time complexity?

A

-time taken is logarithmically proportional to input size

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

what is sigma notation?

A

shorthand for expressing addition sums that may be very long

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

what is the downside of a binary search?

A

can only be performed on a sorted list

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

what is the formal definition of big O?

A

T(n) is in O(f(n)) if positive constants M and n0 are such that T(n) <= M x f(n) for all n >= n0

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

what is the formal definition of big Omega?

A

let T(n) and f(n) be two positive functions
T(n) is omega(f(n)) if even as n becomes arbitrarily large, T(n)’s growth is bounded from below by f(n)- it grows no slower than f(n)
T(n) is part of omega(f(n)) if positive constants M and n0 are such that:
T(n) >= M x f(n) for all n >= n0

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

what is the formal definition of big theta

A

let T(n) and f(n) be two positive functions
T(n) is theta(f(n) if even when n becomes arbitrarily large, T(n)’s growth is bounded from above and below by F(n)- it grows no faster or slower than f(n)
T(n) is part of theta(f(n)) if positive constants M1, M2 and n0 such that:
M1 x f(n) <= T(n)<= M2 x f(n) for all n>= n0

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