Big 0 Notation Flashcards

(8 cards)

1
Q

What are the two types of efficiency ?

A

Time Efficiency - how fast it runs,
Space Efficiency - how much memory it takes up.

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

How do we analyse efficiency ?

A

In terms of input size (n)

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

How do we measure running time ?

A

Using basic operations to keep analysis hardware-independent

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

What is the order of growth ?

A

O(1) - constant
O(log n) - logarithmic
O(n) - linear
O(n log n ) - linearithmic
O(n^2) - quadratic
O(n^3) - cubic
O(n!) - exponential (very inefficient)

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

What is the worst case ?

A

Longest time the algorithm can take.

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

What is the best case ?

A

The Shortest time the algorithm can take.

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

What is the average case ?

A

The expected time over random inputs.

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

What are the Asymptotic notations ?

A

Big O - upper bound (worst-case),
Big Omega (Ω) - lower bound (best case),
Big Theta (Θ) - tight bound (average case).

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