top of page
Landing%2520Page_edited_edited.jpg

IAL Decision 1: Algorithms Exam Questions

10 exam-style questions · 80 marks · about 96 minutes · full mark scheme

Specification: D1 Algorithms

Quick Links

About this chapter

Algorithm questions appear on every recent Decision 1 paper. They reward following a procedure exactly, one step at a time, and showing every stage. The examiners repeat the same advice each series: Decision Mathematics is a methods-based examination, so spotting the correct answer with no working rarely gains any credit.

This chapter covers tracing an algorithm, flow charts, bubble sort, quick sort, sorting in the order asked for, binary search, the three bin-packing algorithms, lower bounds, and deductions from a given packing. The later questions trace Euclid’s algorithm, combine a sort with first-fit decreasing, and work backwards from a packing to the size of the bins.

The ten questions

  • Q1 (6 marks): a bubble sort into descending order, the comparisons and swaps in one pass, and the most passes needed.
  • Q2 (6 marks): a quick sort of ten numbers into ascending order, with clear pivots, and how you know it is finished.
  • Q3 (6 marks): nine parcels in 20 kg crates: a lower bound, first fit, and why the result is optimal.
  • Q4 (6 marks): an algorithm that halves and doubles using INT, traced in a table, and its purpose.
  • Q5 (6 marks): binary search on eleven names, once to find a name and once to show one is missing.
  • Q6 (10 marks): a quick sort into descending order, first-fit decreasing, a lower bound, and why decreasing helps.
  • Q7 (10 marks): deduce the bin size from a given first-fit packing, then repack with first-fit decreasing.
  • Q8 (10 marks): a flow chart traced twice, its purpose, and an output found from the remainders alone.
  • Q9 (10 marks): a quick sort of names into alphabetical order, then two binary searches.
  • Q10 (10 marks): a bubble sort with comparisons and swaps per pass, then first fit and a lower bound.

Key skills tested

Tracing algorithms. Follow each instruction exactly in order and record every value in a table. Do not skip steps that seem obvious.

Flow charts. Follow the arrows, especially on a loop back: return to the box the arrow points to, not the start.

Bubble sort. Compare neighbours from the left and swap if out of order. The sort ends with a pass that makes no swaps.

Quick sort. Choose the middle item as the pivot, using the right-hand middle for an even list, and split the rest either side. Every sublist then needs its own pivot.

Order asked for. Sort into exactly the order requested. Sorting the other way and reversing costs marks.

Binary search. Find the middle position of the current list, compare, then keep the half that could contain the target. Show each middle position.

Bin packing. First fit places each item in the first bin with room; first-fit decreasing sorts first; full bin looks for exact fills.

Lower bound. Divide the total by the bin size and round up. A packing that uses that many bins is optimal.

Deductions. From a given packing, an item that did not fit in a bin shows the bin size is less than that total, which gives inequalities for the size.

Key skills page for IAL Decision 1 Chapter 1, Algorithms: nine skill cards from tracing algorithms to deductions, with a skills map

Worked example

Question 3 from this chapter. Parcels of 8, 15, 4, 12, 9, 6, 11, 7 and 5 kg go into crates holding 20 kg. (a) Find a lower bound for the number of crates. (b) Use first fit. (c) Explain why the result is optimal.

(a) The total is 77, and 77 ÷ 20 = 3.85, so at least 4 crates.

(b) Crate 1: 8, 4, 6. Crate 2: 15, 5. Crate 3: 12, 7. Crate 4: 9, 11.

(c) It uses 4 crates, which equals the lower bound, so no packing can use fewer.

First fit means the first crate with room, so the 5 goes back into crate 2, not the latest crate.

Worked solution to Decision 1 Chapter 1 Question 3: the lower bound is 4 crates, first fit uses 4 crates, so the packing is optimal

Seen on real papers
Every question in our booklets is original. These are the recent papers where each question type has appeared.

  • January 2025, Q1: first-fit bin packing, a quick sort with middle-right pivots, then first-fit decreasing, as in Q2, Q3 and Q6.
  • June 2023, Q2 and Q3: a quick sort pivot, a bubble sort and bin packing, then an unseen algorithm using INT, as in Q1 and Q4.
  • October 2021, Q7: a lower bound linked to an unknown bin size n, then a quick sort and a justified value of n, as in Q7.

Where marks are lost

  • The wrong bin. In January 2025 the most common first-fit error was putting 5 in the third bin instead of the second; June 2023 saw the same with a 6.
  • Pivots. January 2025 saw the final pivot left out, and October 2021 saw middle-left and middle-right pivots mixed in one sort.
  • Stopping a sort early. In June 2023 the fifth bubble sort pass was often omitted; writing “stop” or “sort complete” instead is not enough.
  • The flow chart loop. In January 2025 most mistakes came from going back to the wrong box on the return loop, and many forgot to write the output.

Common questions

How do I pick the pivot in a quick sort?
Take the middle item of each sublist. With an even number of items, choose one rule, usually the right-hand middle, and keep it.

How do I know a bubble sort has finished?
When a whole pass makes no swaps. That last pass must still be shown.

Does a lower bound mean that many bins will work?
No. It is the fewest possible; a packing that reaches it is optimal, but some lists need more.

Where this chapter leads

bottom of page