What does the time complexity of an algorithm primarily measure?
2025
What does the time complexity of an algorithm primarily measure?
- A.
The number of instructions in the source code.
- B.
The amount of time taken by the compiler to convert the code into machine language.
- C.
The number of fundamental operations executed as a function of input size.
- D.
The amount of physical time taken to execute the program on a specific hardware.
Attempted by 156 students.
Show answer & explanation
Correct answer: C
Time complexity is a theoretical metric used in computer science to analyze how an algorithm scales.
Instead of measuring actual clock time, which varies from one computer to another, we count how many primitive operations (e.g., adding two numbers, assigning a value, comparing two items) the algorithm performs.