aimnova.
DashboardMy LearningPaper MasteryStudy Plan

Aimnova site navigation

Stay in the loop

Get the latest study resources and updates

New features, study tips and exam insights — straight to your inbox.

IB Diploma

  • IB Past Papers
  • IB Study Notes
  • IB Question Bank
  • IB Mock Exams
  • IB Revision

IB Subjects

  • IB Math AA
  • IB Math AI
  • IB Economics
  • IB Business Management
  • IB Physics
  • IB Biology
  • View all IB subjects→

IB Past Papers

  • IB Math AA HL Past Papers
  • IB Math AA SL Past Papers
  • IB Math AI HL Past Papers
  • IB Math AI SL Past Papers
  • IB Economics HL Past Papers
  • IB Economics SL Past Papers
  • IB ESS Past Papers
  • View all past papers→

Study Resources

  • Study Notes
  • Question Bank
  • Mock Exams
  • Flashcards
  • Revision Guide
  • Exam Skills
  • Command Terms
  • Grade Calculator
  • Exam Timetable 2026

Aimnova

  • Features
  • Pricing
  • For Schools
  • For Parents
  • About Us
  • Blog
  • Contact
aimnova.

AI-powered study platform for smarter revision, past-paper analysis and examiner-style feedback.

TermsPrivacyCookies·© 2026 Aimnova. All rights reserved.8afc4e3

Aimnova is not affiliated with or endorsed by the International Baccalaureate Organization (IB).

NotesComputer ScienceTopic 6.4Big O notation
Back to Computer Science Topics
6.4.15 min read

Big O notation

IB Computer Science • Unit 6

AI-powered feedback

Stop guessing — know where you lost marks

Get instant, examiner-style feedback on every answer. See exactly how to improve and what the markscheme expects.

Try It Free

Contents

  • How the work grows with the data
  • The four you need
  • Time, space, and why it matters
  • Exam-style question
The big idea: Big O describes how an algorithm's work grows as the data grows.

It is not how long it takes in seconds — that depends on the machine. It is the shape of the growth, which does not.

The four complexities, with the steps each needs at 10, 100 and 1,000 items. Step through them.

Interactive diagram

Explore the labelled diagram, charts and maps for this topic in full study mode.

Claim your free topic

Free preview

This is the free notes preview

You're reading the free notes. Aimnova Pro unlocks the full study experience — and you can try it with your first topic free to keep:

  • FlashcardsLock in vocabulary and key terms with spaced repetition.
  • Practice questionsAnswer exam-style questions and get instant AI marking.
  • Mock exams & past-paper vaultSit full mocks and see exactly how examiners award marks.
  • Personalised study planA daily plan built around your exam date and weak areas.
Start Studying Free Full access to Aimnova Pro · cancel anytime

O(1) and O(log n)

  • O(1) constant — the same work whatever the size
  • Reading an array by position; push and pop on a stack
  • O(log n) logarithmic — doubling the data adds one step
  • Binary search, because each step discards half

O(n)

  • Linear — twice the data, twice the work
  • Linear search, or adding up every value
  • One loop over the data
  • Perfectly acceptable for most purposes

O(n²)

  • Quadratic — twice the data, four times the work
  • Bubble sort and selection sort
  • A loop inside another loop
  • This is what stops working as data grows
How to work it out: Count the loops over the data.

No loop is O(1). One loop is O(n). A loop inside a loop is O(n²). Halving the data each step is O(log n).
Constants are dropped: Two separate loops over the same data is 2n steps — but Big O calls that O(n), not O(2n).

Big O is about the shape of the growth, and a constant multiplier does not change the shape.

Stop wasting time on topics you know

Our AI identifies your weak areas and focuses your study time where it matters. No more overstudying easy topics.

Try Smart Study FreeYour first topic is free to keep • No credit card required

Time complexity

  • How the number of steps grows
  • What people usually mean by Big O
  • Bubble sort: O(n²) time
  • Binary search: O(log n) time

Space complexity

  • How the extra memory grows
  • Not counting the input itself
  • Bubble sort: O(1) space — it sorts in place
  • An algorithm that copies the whole list: O(n) space
The two can be traded: Storing results you have already worked out saves time and costs memory.

Recomputing them each time saves memory and costs time. A question asking you to choose is usually asking which of the two is scarce.
1

Why n² stops working

2

Why log n is so good

3

Small data hides everything

How this is tested — you must derive the complexity from the loops, and say what it means at scale. It comes up two ways:

Paper 2 — working with code

  • Describe or calculate an algorithm's Big O, 3-5 marks
  • Compare two algorithms' scalability
  • Choose one for a stated amount of data

Paper 2 — the algorithmic-thinking question

  • The no-code question often asks for reasoning about growth
  • Explain why one algorithm stops being usable
The classic trap: Treating Big O as a measure of speed. An O(n²) algorithm can beat an O(n log n) one on small data. Big O says how the work grows, which is what matters as data scales.
IB-style questionDescribe[5 marks]

Give the time complexity of this, explain how you worked it out, and say what happens if the list grows from 1,000 to 10,000 items.

for i in range(len(items)): for j in range(len(items)): if items[i] == items[j] and i != j: print("Duplicate")

Model answer plan

See the mark-by-mark plan — for / against / judgement, with marking guidance — in study mode.

Claim your free topic
IB-style questionDescribe[5 marks]

Give the time complexity of this, explain how you worked it out, and say what happens if the list grows from 1,000 to 10,000 items.

for (int i = 0; i < items.length; i++) { for (int j = 0; j < items.length; j++) { if (items[i] == items[j] && i != j) { System.out.println("Duplicate"); } } }

Model answer plan

See the mark-by-mark plan — for / against / judgement, with marking guidance — in study mode.

Claim your free topic

Try an IB Exam Question — Free AI Feedback

Test yourself on Big O notation. Write your answer and get instant AI feedback — just like a real IB examiner.

what Big O notation describes. [1 mark]

Related Computer Science Topics

Continue learning with these related topics from the same unit:

6.1.1Variables and data types
6.1.2Substrings
6.1.3Exception handling
6.1.4Debugging
View all Computer Science topics

Improve your exam technique

Command terms, paper structure, and mark-scheme tips for Computer Science

Previous
6.3.4Functions and modularity
Next
Linear and binary search6.4.2

21 practice questions on Big O notation

Students who practiced this topic on Aimnova scored 82% on average. Try free practice questions and get instant AI feedback.

Try 3 Free QuestionsView All Computer Science Topics