Exam-style question
Try this first
When comparing the time efficiency of two algorithms, which factor is most important to consider?.
- A.The colour used in the program interface
- B.The size of the problem being solved
- C.The name of the programming language only
- D.The number of comments in the code
Model answer
What a good answer should say
- The size of the problem being solved
Explanation
Why this works
Algorithm complexity is expressed as a function relative to the size of the problem. The size of the input or problem is therefore a key issue when comparing algorithms.
Common mistake
No common mistake is linked to this question yet.
