In IB Computer Science, algorithms are where confidence is built -- and where it collapses under time pressure.
Most students don’t lose marks because they’ve never heard of binary search or bubble sort. They lose marks because the exam asks for something slightly unfamiliar: trace the algorithm with a tricky input, adapt it, or explain why it’s efficient. In IB Computer Science, that “why” is often the difference between a vague answer and a 7-level one.
This guide focuses on the most important algorithms to know for IB Computer Science, what the IB tends to test, and how to practise them in a way that actually sticks.

Quick checklist: the algorithms to prioritise
If you want a high-yield revision list for IB Computer Science, start here:
-
Searching algorithms: linear search, binary search
-
Sorting algorithms: bubble sort, selection sort, insertion sort, merge sort
-
Recursion (HL focus, but shows up conceptually): factorial, Fibonacci, divide-and-conquer logic
-
Graph algorithms (HL): DFS, BFS, Dijkstra’s shortest path
-
Everyday data handling: array traversal, counting, min/max, string manipulation
A practical way to turn this into marks is to pair your notes with timed practice: use the Questionbank for exam-style questions, and keep quick recall alive with Programming Algorithms Flashcards.
Searching algorithms in IB Computer Science
Searching is deceptively simple in IB Computer Science because the IB rarely asks you to just “state the steps.” It asks you to choose the right method, trace it precisely, or justify performance.
Linear search
Linear search is the workhorse: check each item until you find the target or hit the end.
What the exam likes:
-
Tracing variable updates cleanly (index, found flag, count)
-
Recognising that it works on unsorted data
-
Explaining why it can be slow for large lists (it may check everything)
To practise it in IB-style format, use B2.4.2 Linear and Binary Search Questions.
Binary search
Binary search is the classic “divide the search space in half” algorithm.
What the exam loves:
-
The condition: the data must be sorted
-
Correct boundary updates (low/high/mid)
-
Explaining why it’s efficient (each step halves the problem)
Revision shortcut: read the pseudocode once, then trace it with tiny lists until you can predict each mid-point without guessing. The B2.4.2 Notes are perfect for that.
Sorting algorithms: where method marks live
Sorting shows up constantly in IB Computer Science because it’s ideal for testing logic, tracing, and reasoning about efficiency.

Bubble sort
Bubble sort repeatedly compares adjacent items and swaps them.
Why it matters in IB Computer Science:
-
It’s easy to trace, so it’s a common exam tool
-
It trains you to show iterations clearly (passes, swaps, stopping condition)
-
You can comment on inefficiency for large inputs
Selection sort
Selection sort repeatedly selects the smallest (or largest) remaining item and places it in position.
Exam cues:
-
Show how the “current minimum” changes
-
Be explicit about the boundary between sorted and unsorted sections
Insertion sort
Insertion sort builds a sorted section by inserting each new element into the right place.
Why it’s a great algorithm to understand:
-
It rewards clear explanation of shifting elements
-
It’s often faster than bubble/selection on nearly sorted data
Merge sort
Merge sort uses divide-and-conquer: split, sort sublists, merge.
In IB Computer Science, merge sort is where students often lose easy marks because:
-
They can describe it, but can’t trace the merge step
-
They forget that recursion is part of the logic
If you want the underlying “how to revise” routine, pair this article with Best Way to Revise Algorithms for IB Computer Science (Paper 1).
Recursion: small inputs, big consequences
Recursion is one of those IB Computer Science topics that feels fine until you’re asked to trace it under pressure.

What to know:
-
Base case: when the recursion stops
-
Recursive case: how the problem reduces
-
Tracing: list calls and returns in order
Standard examples:
-
Factorial
-
Fibonacci
-
Any divide-and-conquer approach (including merge sort)
HL students should connect recursion practice to broader skills like computational thinking. If that concept feels fuzzy, read What Is Computational Thinking in IB Computer Science?.
Graph algorithms (HL): the ones you can’t cram
For HL IB Computer Science, graph algorithms are high value because they’re structured, repeatable, and easy to assess.
Focus on:
-
DFS (Depth-First Search): go deep, then backtrack
-
BFS (Breadth-First Search): explore neighbours level-by-level
-
Dijkstra: shortest path in a weighted graph (track tentative distances)
The secret is not memorising the final path. It’s showing the process: visited nodes, queue/stack behaviour, and distance updates.
Common mistakes in IB Computer Science algorithms
These patterns show up again and again:
-
Writing Java/Python syntax instead of IB-style pseudocode logic
-
Skipping tracing tables (then losing method marks)
-
Using binary search on unsorted data
-
Explaining “it’s faster” without referencing halving steps or comparisons
-
Leaving HL graph algorithms until the final week
To keep your overall revision structure tight, the IB Computer Science Last-Minute Study Plan is a good reality check -- even if you’re not last-minute.
How RevisionDojo helps you master IB Computer Science algorithms
The fastest improvements in IB Computer Science come from a loop: understand the template, practise questions, get feedback, repeat.
RevisionDojo is built for that loop:
-
Study Notes for clean explanations (start with B2.4 Programming Algorithms Notes)
-
Flashcards for daily recall
-
Questionbank for exam-style drilling with solutions
-
AI Chat to get unstuck when your tracing goes sideways
-
Grading tools to learn what earns method marks
-
Predicted Papers and Mock Exams to rehearse timing (see IB Predicted Papers)
-
Coursework Library plus Tutors when your IA and revision collide
If you want the bigger picture of what matters most for marks, use The Most Important Topics to Revise for IB Computer Science (Paper 1) alongside this algorithms list.
Conclusion: the small set that moves your grade
The most important algorithms for IB Computer Science are not a huge list. They’re a focused toolkit: searching, sorting, recursion, and HL graph methods, plus the everyday data-handling patterns that sit underneath them.
If you want a simple plan: learn one algorithm template, trace it until it feels boring, then switch to timed questions. RevisionDojo makes that routine easier with Study Notes, Flashcards, a deep Questionbank, AI Chat support, Grading tools, and realistic Predicted Papers and Mock Exams.
When you can explain and trace algorithms calmly, IB Computer Science stops feeling like a subject you cram -- and starts feeling like a skill you own.