Recursion and computational thinking

Stack frames and recursion, then the computational thinking behind every large program: abstraction of every kind, decomposition and composition, thinking ahead, logically and concurrently, and the computational methods, ending with a robot that backtracks out of a dead end.

Module A2A level10 lessons

Start in the simulator
  1. A2.1 Stack frames and the call stack Return addresses, parameters and local variables: what a subroutine call pushes, and what a return pops.
  2. A2.2 Recursion Base case and general case, winding and unwinding, and a spiral the robot draws by calling itself.
  3. A2.3 Recursion versus iteration The same algorithm both ways, the cost of a frame per call, repeated work, and stack overflow.
  4. A2.4 Abstraction and models Representational abstraction, generalisation, problem reduction, and a grid model of the mat that differs from reality.
  5. A2.5 Procedural, functional and data abstraction Information hiding, hiding the values, the method and the representation, and swapping a data type's insides.
  6. A2.6 Decomposition, composition and automation Thinking procedurally, compound procedures and compound data, and putting a model into action.
  7. A2.7 Thinking ahead and thinking logically Inputs, outputs and preconditions, caching and reuse, decisions and conditions, and solving logic problems.
  8. A2.8 Thinking concurrently Concurrent and parallel processing, what can happen at once, benefits and trade-offs, and pipelining.
  9. A2.9 Computational methods Problem recognition, divide and conquer, backtracking, heuristics, performance modelling, data mining and visualisation.
  10. A2.10 Project: out of the dead end Model a maze, solve it by recursive backtracking, and drive the robot out along the route.