AQA A-level Computer Science (7517)Specification point 4.1.1.16

AQA 7517 4.1.1.16: Recursive techniques

The free BugBot lessons that teach this point, a robot to try it on, and the past-paper questions that test it.

What it covers

At GCSE, merge sort (F5.9) sorted each half of a list "the same way", with a function that called itself. That idea is recursion: a subroutine that solves a problem by calling itself on a smaller version of the same problem. This lesson is about how to write recursion correctly, and how the call stack from the last lesson makes it work.

  • Base case and general case
  • Winding and unwinding
  • What goes wrong
  • Recursion on the robot
Read the free lesson (25 min)

Or do it in the simulator, with tasks that mark themselves

Lessons that teach it

  1. A2.2 Recursion Recursion and computational thinking
    Base case and general case, winding and unwinding, and a spiral the robot draws by calling itself.
  2. A2.3 Recursion versus iteration Recursion and computational thinking
    The same algorithm both ways, the cost of a frame per call, repeated work, and stack overflow.
  3. A2.10 Project: out of the dead end Recursion and computational thinking
    Model a maze, solve it by recursive backtracking, and drive the robot out along the route.

Try it on a robot

The task from A2.2 Recursion, running here. Change the program and press Run.

The specification is AQA's own document; this page says which of our lessons teach point 4.1.1.16 and is not endorsed by the board.