Week 3 Flashcards

1
Q

measures the worst-case complexity of an algorithm. n represents the number of inputs.

A

The Big-O notation

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

does not change with respect to input space. Hence, it is referred to as being —. An example of an it algorithm is accessing an item in the array by its index.

A

O(1) - Constant Time

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

applies to algorithms that must do n operations in the worst-case scenario.

A

O(n) - Linear Time

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

The runtime grows logarithmically as the input size increases. Typically seen in algorithms that divide the problem in half each time.

A

O(log n) - Logarithmic Time

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

The runtime grows proportionally to the square of the input size. Often seen in algorithms with nested loops.

A

O(n^2) - Quadratic Time

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

The runtime grows proportionally to the cube of the input size. Less common but seen in some complex algorithms with multiple nested loops.

A

O(n^3) - Cubic Time

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

The runtime grows faster than exponential time. This is extremely inefficient and rare.

A

O(n^n) - Exponential Time (Super-Exponential)

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