▲ Camp45
Sign inTry free for 7 days

Computer Science · Theme B: Computational thinking and problem-solving

B2.4 — Programming algorithms

Computer Science · SL / HL · syllabus-mapped notes

  1. CS_B2.4.1

    Big O notation and efficiency

    Time and space complexity, calculating Big O, and choosing by scalability.

    Full note — free

    Big O notation describes how an algorithm scales: how its running time or memory grows as the input size n grows. You must be able to describe efficiency by calculating it. Time and space complexity Time complexity : how the number of operations grows with n. Space complexity : how the extra memory used grows with n. Common orders (best to worst) O(1) constant, unaffected by n. O(log n) logarithmic, halves the problem each step (binary search). O(n) linear, one pass (linear search). O(n log n) good sorts (quicksort average). O(n^2) quadratic, a nested loop over the data (bubble sort, selection sort). Calculating it Count how operations depend on n and keep only the fastest-growing term, dropping constants: a loop over n is O(n); a loop inside a loop is O(n^2). Choosing by scalability e.g. for a small list an O(n^2) sort is fine, but for millions of items an O(n log n) algorithm scales far better.

  2. CS_B2.4.2

    Linear search and binary search

    Constructing, tracing and comparing the two search algorithms.

    You must be able to construct and trace a linear search and a binary search , and compare their efficiency. Linear search O(n), works on any list Check each element in turn until the target is found or the list ends. e.g. def linear(a, target): …

    Read the full note free for 7 days →

  3. CS_B2.4.3

    Bubble sort and selection sort

    Constructing, tracing and evaluating the time and space complexities of each sort.

    You must be able to construct and trace bubble sort and selection sort , and evaluate their time and space complexities. Bubble sort Repeatedly pass through the list, swapping any two adjacent elements that are out of order, until no swaps are needed. Large values …

    Read the full note free for 7 days →

  4. CS_B2.4.4

    The concept of recursion (HL)

    Fundamentals, advantages and limitations, with applications including quicksort.

    This card is HL only. You must be able to explain recursion : a technique where a function calls itself to solve a smaller version of the same problem. Fundamentals A recursive function has a base case (a simple case solved directly, which stops the …

    Read the full note free for 7 days →

  5. CS_B2.4.5

    Constructing recursive algorithms (HL)

    Constructing and tracing simple, non-branching recursive algorithms.

    This card is HL only. You must be able to construct and trace simple, non-branching recursive algorithms (a single recursive call each time). Constructing a recursive function Write the base case first, then the recursive case that moves toward it. e.g. factorial def factorial(n): if …

    Read the full note free for 7 days →

This topic has 5 full notes in Camp45 — with flashcards, a quiz and Sherpa, the AI tutor, on every one. Try 7 days free →
Sherpa, your Camp45 mountain guide
Hi, I'm Sherpa — your IB mountain guide.
I take you from your material to the syllabus summit. Ask me anything, hand me your essay or your notes — I'll turn it into your system.
💬
Ask me anything
Any of the 26 subjects — I answer from the syllabus.
📝
Essay check
I grade your draft and flag what reads like AI.
📄
Upload your notes
Handout or textbook page → your own syllabus map.
🃏
Flashcards & decks
I turn any topic into a deck you can drill.
3 of 3 free questions — no sign-up.
📝 Check your essay before you hand it in
Sherpa grades it against the IB criteria and flags passages that read like AI — so you can fix them first.

Full notes + a tutor. Every subject, one payment.

Camp45 turns the syllabus into notes that give you exactly what the exam asks — so you study smarter, not harder.

Monthly

€19/mo

All the notes, cancel anytime

Go monthly
Most popular

Full-year access

€149

Every subject, paid once

Get full-year access

Both diploma years

€229

Both years, paid once

Get both years

Syllabus-exact notes

Every understanding statement written out in full — nothing more than the exam asks, nothing left out.

A tutor that answers from the syllabus

Ask anything and it answers from the exact points you are studying.

Every subject, one payment

All 26 IB subjects, SL & HL, covered by a single payment — no per-subject fees.

No credit card. Try the free Biology preview before you commit.