IB Computer Science HL · Year 2 · Lesson 9

Recursion: concepts, tracing and construction

Algorithms must be understood operationally: how they behave, how to trace them, and when their efficiency makes them suitable.

Paper 250 minutesB2.4.4 · B2.4.5
Today’s targets

What you need to be able to do

2 / 8
  • ExplainThe fundamental concept of recursion and its applications in programming
  • Construct + traceAnd trace recursive algorithms in a programming language
B2.4.4B2.4.5
Paper 2 lensMatch the depth of every response to the command term. Previously learned content can move quickly, but retrieval must still be accurate.
Retrieve

Rapid Recall Deck

3 / 8

Say the answer aloud before flipping. Mark secure knowledge quickly and spend time on the gaps.

  • What is recursion?: A technique in which a function or method solves a problem by calling itself on a smaller version of the same problem.
  • What is the purpose of a base case in recursion?: It stops further recursive calls and provides a direct result, preventing infinite recursion.
  • What is the recursive case?: The part that reduces the problem and makes another call using a smaller or simpler input.
  • Why can recursion be useful?: It can express problems that naturally break into smaller similar subproblems in a clear, compact way.
  • What are common limitations of recursion?: Recursive calls consume call-stack memory and can be slower or risk stack overflow when recursion becomes too deep.
  • What does non-branching recursion mean?: Each recursive call follows a single recursive path rather than splitting into multiple recursive calls from the same call.
B2.4.4 + B2.4.5 · Learn

Core knowledge and application

4 / 8
B2.4.4Explain

The fundamental concept of recursion and its applications in programming

Algorithms must be understood operationally: how they behave, how to trace them, and when their efficiency makes them suitable.

Exam moveGive the mechanism or relationship and make the reasons/causes explicit.
Required detail 1The fundamentals of recursion and its advantages and limitations
Required detail 2The utility of recursion in solving problems that can be broken down into smaller, similar sub- problems
Required detail 3Recursive algorithms, including but not limited to quicksort
Required detail 4The limitations of recursion, including complexity and memory usage
Required detail 5Situations that best suit the use of recursion, including fractal image creation, traversing binary trees, sorting algorithms
Assessment boundaryPaper 2

Explain it without notes

Explain: The fundamental concept of recursion and its applications in programming in the context of a program that searches and organizes a growing dataset.

  • The fundamentals of recursion and its advantages and limitations
  • The utility of recursion in solving problems that can be broken down into smaller, similar sub- problems
  • Recursive algorithms, including but not limited to quicksort
  • The limitations of recursion, including complexity and memory usage
  • Situations that best suit the use of recursion, including fractal image creation, traversing binary trees, sorting algorithms
B2.4.5Construct + trace

And trace recursive algorithms in a programming language

Algorithms must be understood operationally: how they behave, how to trace them, and when their efficiency makes them suitable.

Exam moveProduce the required code, diagram, query, model or representation accurately.
Required detail 1Simple, non-branching recursive algorithms in programming only
Assessment boundaryPaper 2

Explain it without notes

Construct + trace: And trace recursive algorithms in a programming language in the context of a program that searches and organizes a growing dataset.

  • Simple, non-branching recursive algorithms in programming only
Trace / construct

Programming checkpoint

5 / 8
def factorial(n):
    if n <= 1:
        return 1
    return n * factorial(n - 1)
Before you run itTrace the code by hand. Identify state changes, branch/loop behaviour, and the final result.

Modify it

Change one condition, input or operation so the program solves a slightly different problem. Predict the effect before editing.

Apply

Transfer to a new scenario

6 / 8
ScenarioA program that searches and organizes a growing dataset needs a design or technical decision related to today’s topic. Explain what matters and why.
  • The fundamentals of recursion and its advantages and limitations
  • The utility of recursion in solving problems that can be broken down into smaller, similar sub- problems
  • Simple, non-branching recursive algorithms in programming only
Exam lens

Paper 2 practice

7 / 8
Build the response before checking notesUse precise terminology and match the required depth.
  1. Explain: The fundamental concept of recursion and its applications in programming in the context of a program that searches and organizes a growing dataset.
  2. Construct + trace: And trace recursive algorithms in a programming language in the context of a program that searches and organizes a growing dataset.
Self-checkAnswer the exact command term. For explain, include mechanism/reason; for compare, pair criteria; for discuss/evaluate/justify, build supported reasoning and a conclusion.
Homework

Finish the learning cycle

8 / 8

IA — main task

Refine Criteria A/B/C. Use today’s lesson to make the problem specification, decomposition, algorithms or testing plan more precise where relevant.

Syllabus — 10–15 min

Repeat the recall deck and complete the lesson response prompt without model support.