Lesson 7.1 · Answer it
Timing on two computers
5 marksYou mark it yourself against the marking points
Aiko and Ben run the same program, which checks a list of names for a typing mistake. It looks at each name once.
- Aiko runs it on her old laptop with a list of 5000 names. It takes 0.9 seconds.
- Ben runs it on his new computer with a list of 20000 names. It takes 0.6 seconds.
Ben says his run shows that the program copes better with bigger lists.
(a) State what is meant by the efficiency of an algorithm. [1]
(b) Explain why the two times cannot be compared to judge the program's algorithm. [2]
(c) The program makes one comparison for each name. State how many comparisons each run makes. [1]
(d) Use your answer to (c) to explain why Ben's claim is wrong. [1]
[5]