‹ Back to the paper
Question 11(i)
2 marks
Computer ScienceISC 2024 Specimen Computer Science Paper 1Short answerComplexity and Big O notation
Answer the following.
With the help of an example, briefly explain the constant factor in time complexity.
Answer
Answer
In time complexity analysis, the constant factor is a multiplicative coefficient in a term that does not depend on the input size n. Big-O notation ignores constant factors because, as n becomes very large, they do not change the growth rate (order) of the algorithm - only the relative rate at which the running time grows with n matters.
Example: An algorithm that performs $5n$ operations and another that performs $3n$ operations for an input of size n are both $O(n)$ - the constants 5 and 3 (the constant factors) are dropped, since both algorithms still grow linearly with n.