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