Efficiency and Big O
Efficiency describes how the running time or memory of an algorithm grows as the input becomes larger.
▶ Interact
Play with the controls to see the idea in action.
📘 Learn
Efficiency describes how the running time or memory of an algorithm grows as the input becomes larger.
- Linear time grows steadily
- Quadratic time grows rapidly
- Better algorithms save time
🧠 Quick quiz
Three questions. Score 2 or more to complete the topic.
What is Efficiency and Big O?
Within Computer Science, which covers algorithms, programming, data, networks, hardware and safe, responsible use of technology, this topic explains Efficiency and Big O. Computing topics explain how software, hardware and data work, with diagrams and models that show each step in order.
Check that you can explain Efficiency and Big O in your own words and give one example from everyday life. If you can do that, you have understood the core idea.
Understanding Efficiency and Big O helps you design, test and explain programs, websites and systems, from small projects to exam questions.
Efficiency and Big O in detail
Algorithm efficiency describes how much time and memory a solution needs as the input size grows. Big O notation describes how the number of steps grows with input size n, ignoring constants. O(1) is constant time, O(log n) is logarithmic (binary search), O(n) is linear (linear search), O(n log n) is typical of good sorting methods and O(n²) is quadratic (bubble sort).
Slow growth rates matter when data is large: doubling the input doubles the time for O(n) but quadruples it for O(n²). Understanding efficiency helps you pick suitable algorithms and write programs that run quickly on real data.
How the interactive helps you understand Efficiency and Big O
Watch the growth curve in the interactive. Use any sliders or buttons it offers to change the values and see how the growth curve responds.
Before you change anything, predict the result. Then change one value at a time and check whether your prediction was right. This is a quick way to build a correct mental model of Efficiency and Big O.
Real-life uses and examples
- Apply Efficiency and Big O when you design a small program, website or spreadsheet.
- Explain Efficiency and Big O to someone new to computing by comparing it to a familiar process.
- Trace through a process that uses Efficiency and Big O to check what it does step by step.
Common mistakes to avoid
- Testing only the normal case and forgetting the edge cases.
- Using the term without being able to say what the computer actually does.
- Learning the definition without testing it. Use the quiz and the interactive to check that you can apply the idea.
Frequently asked questions about Efficiency and Big O
What is Efficiency and Big O?
Efficiency describes how the running time or memory of an algorithm grows as the input becomes larger.
What are the most important points about Efficiency and Big O?
The main points are: Linear time grows steadily; Quadratic time grows rapidly; Better algorithms save time.
Why is Efficiency and Big O useful?
Understanding Efficiency and Big O helps you design, test and explain programs, websites and systems, from small projects to exam questions.
How can I practise Efficiency and Big O?
Open the interactive at the top of this page and change the controls one at a time. Predict the result before each change, then take the three-question quiz. A score of two or more marks the topic as complete on this device.
Which topics are related to Efficiency and Big O?
Related topics in Computer Science include Object-Oriented Programming, Introduction to Python, Introduction to JavaScript.