Space/Time Complexity Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Constant Time Complexity

A

O(1)

The amount of time taken to complete an algorithm is independent from the number of elements inputted

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

Linear Time Complexity

A

O(n)

The amount of time taken to complete an algorithm is directly proportional to the number of elements inputted

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

Polynomial Time Complexity

A

O(n n)

The amount of time taken to complete an algorithm is directly proportional to the elements inputted to the power of n

For example :
O(n2)

The amount of time taken to complete an algorithm is directly proportional to the square of the elements inputted

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

Exponential Time Complexity

A

O(2n)

The amount of time taken to complete an algorithm will double with every additional item

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

Logarithmic Time Complexity

A

O(log n)

The time taken to complete an algorithm will increase at a smaller rate as the number of elements inputted

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

Time Complexity

A

A measure of the amount of time needed by an algorithm to solve a particular problem of a given input size

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

Space Complexity

A

A measure of the amount of memory space needed by an algorithm to solve a particular problem of a given input size

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

Big O Notation

A

A way of classifying algorithms based on their complexity by setting an upper bound for the worst case time or space complexity as a mathematical function of input size

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