Time complexities Flashcards

1
Q

Describe O(n) notation

A

Time complexity of O(n) means the time taken in the worst case is proportional to n, where doubling the input size results in a twofold increase in execution time.

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

Describe O(n^2)

A

Time complexity of O(n^2) means that time taken in the worst case increases with the square of n, where doubling input size will lead to 4 fold increase in execution time.

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

Describe O(log n)

A

Time complexity of O(log n) means that the time taken in the worst case scenario is proportional to log n, where doubling the input size results in a sqrt(2) increase in execution time.

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

Describe O(1) notation

A

Time complexity of O(1) means that regardless of data size, execution time will be consistent.

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