Time Complexity and Big O Notation
An OCR A-Level walkthrough of Big O: what time complexity means, the wording the mark scheme wants, and how to name logarithmic and exponential complexity
By Hashir Ali, , 5 min read
This week's A-Level lesson was an OCR exam question about two solutions to the same problem. Both have a time complexity of O(n), but one needs O(kn) space and the other O(log n). The question asks you to explain what time complexity means, with reference to those Big O values, and then to name the space complexity of each solution. Nearly every mark comes down to using the right words.

What time complexity actually means
Time complexity is not how many seconds an algorithm takes. A fast laptop runs the same algorithm quicker than an old school computer, and that tells you nothing useful about the algorithm. Time complexity describes how the time taken scales as the number of data items grows, written in Big O notation, where n is the number of data items.
So O(n) is linear complexity: the time taken increases at the same rate as the number of data items. Double the data and you roughly double the time. Both solutions in the question are O(n), so on time alone there is nothing to choose between them.
The mark scheme gives one mark per point, and there are three points to make:
- time complexity is about how the time scales as the data size increases
O(n)is linear complexity- the time increases at the same rate as the number of data items increases
Written out as a full answer: "Time complexity describes how the time taken by an algorithm scales as the number of data items increases. Both solutions are O(n), which is linear complexity, so the time taken increases at the same rate as the number of data items." Three sentences, three marks.
The shapes you should be able to sketch
Sketching these in the margin is the quickest way to decide which complexity is better. Anything that flattens out, like O(log n), barely notices extra data. A straight line, O(n), keeps pace with it. A curve that bends upwards, like O(n²), gets worse faster than the data grows, and an exponential curve becomes unusable almost immediately.
Putting real numbers against them makes the difference obvious:
| Complexity | n = 10 | n = 100 | n = 1000 |
|---|---|---|---|
| O(log n) | 3 | 7 | 10 |
| O(n) | 10 | 100 | 1,000 |
| O(n²) | 100 | 10,000 | 1,000,000 |
| O(2n) | 1,024 | a 31-digit number | hopeless |
Those are counts of basic steps, not seconds, and the exact figures don't matter. The pattern does: the bottom row is why exponential algorithms are only ever used on tiny inputs.
Naming each complexity
The second part of the question simply asks you to name the space complexity of each solution, so the vocabulary needs to be off by heart:
| Big O | Name | Typical example |
|---|---|---|
| O(1) | Constant | Reading one element of an array by index |
| O(log n) | Logarithmic | Binary search on a sorted list |
| O(n) | Linear | A single pass through a list |
| O(nk) | Polynomial | Nested loops, such as bubble sort at O(n²) |
| O(kn) | Exponential | Trying every possible combination by brute force |
So the two answers are:
- Solution A,
O(kn)where k > 1: exponential space complexity. - Solution B,
O(log n): logarithmic space complexity.
The trap: exponential is not polynomial
This is the one that cost a mark in the lesson, and it catches almost everybody. O(kn) looks a lot like O(nk), but they are completely different:
- Polynomial:
nis the base and the power is fixed, as inn². Add one data item and the cost grows a little. - Exponential: the base is fixed and
nis the power, as in2n. Add one data item and the cost multiplies.
With k = 2, going from 10 data items to 20 takes a polynomial n² algorithm from 100 steps to 400. It takes an exponential 2n algorithm from about a thousand steps to about a million. The rule to remember: n underneath is polynomial, n on top is exponential.
Why the question gives you both solutions
Questions like this are really asking which solution would you choose, and why. Time complexity can't separate these two, because both are O(n). Space complexity can: Solution A's memory use multiplies with every extra data item, while Solution B's barely grows at all, even for huge amounts of data.
Solution B is the better choice, and it is worth saying so explicitly if the question asks you to justify one. Complexity is usually a trade-off, with an algorithm buying speed by using more memory or saving memory by doing more work. Here, Solution A pays a huge amount of memory and gets no extra speed for it.
Where marks are lost
- Talking about seconds. "It takes n seconds" scores nothing. Big O is a rate of growth, not a measurement of time.
- Ignoring "with reference to". If the question quotes
O(n), your answer has to use it. Define the term and apply it to the solutions. - Mixing up time and space. Time complexity is how the run time grows; space complexity is how the memory used grows. Same notation, different thing.
- Calling
O(kn)polynomial. It is exponential, and it is the worst entry in the table for a reason. - Keeping the constants. Big O describes the dominant term only, so
O(2n + 5)is writtenO(n), andO(n² + n)is writtenO(n²).
Try it yourself
Solution A needs O(kn) space. Taking k = 2, work out how many units of memory it needs for 10, 20 and 30 data items, then answer this: what happens to the memory requirement each time you add just one more data item? That sentence is the definition of exponential growth in your own words.
Key takeaways
- Time complexity is how the time taken scales as the number of data items increases, not how long an algorithm takes in seconds.
O(n)is linear: the time increases at the same rate as the data.- Learn the names: constant, logarithmic, linear, polynomial, exponential.
nin the power means exponential, and exponential means unusable for largen.
Big O comes up on both OCR A-Level papers, and the marks are in the wording rather than the maths. If you'd like help turning understanding into full marks, take a look at our exam preparation lessons.