Exam-style question
Try this first
An algorithm performs a fixed number of instructions, regardless of the size of its input. What is its time complexity?.
- A.O(1)
- B.O(log n)
- C.O(n)
- D.O(2^n)
Model answer
What a good answer should say
- O(1)
Explanation
Why this works
The running time does not grow as the input size n increases, so the algorithm has constant time complexity, written as O(1).
Common mistake
No common mistake is linked to this question yet.
