Eduqas A-Level Computer Science A500QS
Data Structures: Arrays, Records and Hash Tables
Stacks, Queues, Linked Lists and Trees
Boolean Logic and Simplification
Algorithms, Pseudo-Code and Programming Constructs
Variables, Scope, Parameters and Identifiers
Recursion and Modular Programming
Sorting Algorithms
Searching and Shortest-Path Algorithms
Big O Notation and Algorithm Efficiency
Validation, Verification and Testing
Data Compression
Programming Paradigms and Computer Languages
Systems Analysis, Maintenance and Documentation
System Design and Human-Computer Interaction
Software Engineering Tools and Translators
Computing, Society and the Law
Computer Architecture, the Processor and Assembly Language
Input, Output and Secondary Storage
Networks, Protocols and the Internet
Data Transmission and Network Performance
Number Systems and Binary Arithmetic
Data Types, Characters and Floating Point
Files, Records and File Organisation
Databases, Normalisation and Entity Modelling
SQL, Big Data and Distributed Systems
The Operating System and Its Modes
Interrupts, Memory Management and Scheduling
Types of Software System
Data Security, Cryptography and Attack
Recursion and Modular Programming
- 7 subtopics
- 21 things to know
- Component 1
What Recursion and Modular Programming covers
Recursion and Modular Programming is examined in Component 1, Programming and System Development. It covers recursion and the base case, how recursive calls use the stack, recursive algorithms: factorial and Fibonacci, recursion compared with iteration, integer division with DIV and MOD, standard functions and standard modules and user defined subprograms and modular design.
The 7 subtopics
Each one has its own page.
- Recursion and the base caseBase case, two essential parts of any recursive definition and what is meant by the depth of recursion.Open →
- How recursive calls use the stackCall stack used for during recursion and stack frame.Open →
- Recursive algorithms: factorial and FibonacciFibonacci sequence recursively and why the towers of Hanoi puzzle is naturally recursive.Open →
- Recursion compared with iterationWhat tail recursion means, iterative version of the factorial algorithm and why recursion can make a program harder to debug.Open →
- Integer division with DIV and MODThe whole-number quotient and the remainder, worked with real figures, and the jobs they do — extracting digits, converting units, and testing divisibility.Open →
- Standard functions and standard modulesStandard function, two standard mathematical functions found in most languages and standard module or library.Open →
- User defined subprograms and modular designUser defined subprogram, modular programming and interface of a module.Open →
What you need to know
Answer each one before you reveal it.
What does the call stack hold while a recursion is running?
State the value of 5 factorial.
Define iteration.
What does the DIV operator return?
What is a standard function?
What is a user defined subprogram?
What is recursion?
What is the call stack used for during recursion?
Define the Fibonacci sequence recursively.
Give two advantages of recursion over iteration.
What does the MOD operator return?
Give three examples of standard string functions.
What is modular programming?
What is a base case, and why must a recursive subprogram have one?
What is a stack frame?
List the first seven terms of the Fibonacci sequence starting from 1.
Give two disadvantages of recursion compared with iteration.
State the values of 17 DIV 5 and 17 MOD 5.
Name two standard mathematical functions found in most languages.
Give three benefits of modular programming.
Take Recursion and Modular Programming further
The same content, four other ways.
Commonly confused
Pairs that lose marks when they are blurred together.
Recursion vs Iteration
Recursion: repeating by calling itself and building a new stack frame each time. Iteration: repeating with a loop and reusing one set of variables.
Base case vs Recursive case
Base case: returning without calling again. Recursive case: calling itself on a smaller problem.
DIV vs MOD
DIV: giving the whole number of times the divisor fits. MOD: giving what is left over.
Questions from this topic
Each one with the model answer underneath.
- 1
What is recursion?
Model answer
Recursion is a technique in which a subprogram calls itself to solve a smaller version of the same problem. Each call works on a simpler case than the one before.
- 2
What is a base case, and why must a recursive subprogram have one?
Model answer
A base case is a condition that returns an answer without any further call. Without a base case the recursion never stops and the program crashes.
- 3
State the two essential parts of any recursive definition.
Model answer
A recursive definition needs a base case that stops the recursion. A recursive case then calls the subprogram on a smaller problem.
- 4
What happens if the recursive case never moves towards the base case?
Model answer
The subprogram calls itself for ever and the call stack fills. The program halts with a stack overflow error.
- 5
Give the recursive definition of the factorial of a positive integer n.
Model answer
The factorial of 0 is defined as 1. The factorial of n is n multiplied by the factorial of n − 1.
- 6
Why is a recursive solution often described as elegant?
Model answer
A recursive solution expresses the problem almost exactly as it is defined mathematically. The code is short and its intention is clear.
What is inside Levo
Six ways to work the same material.
Recursion and Modular Programming revision questions
- What does Recursion and Modular Programming cover in Eduqas A-Level Computer Science?
- 7 subtopics: recursion and the base case, how recursive calls use the stack, recursive algorithms: factorial and fibonacci, recursion compared with iteration, integer division with div and mod, standard functions and standard modules and user defined subprograms and modular design. Each one has its own page with questions and model answers.
- How is Recursion and Modular Programming organised?
- By the Eduqas A500QS specification, subtopic by subtopic, so it matches the order you are taught it in.
Every question in Recursion and Modular Programming, on a schedule.
Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.
Or £46 a year, about £3.83 a month. Cancel anytime.