Time complexities Flashcards
Describe O(n) notation
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.
Describe O(n^2)
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.
Describe O(log n)
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.
Describe O(1) notation
Time complexity of O(1) means that regardless of data size, execution time will be consistent.