logo

AQA A-Level Computer Science practice

What is the main purpose of a base case in a recursive algorithm?

Try the question first, then check the answer and practise the same topic again.

At a glance

MCQ

Type

practice

Style

Topic

Programming

Exam-style question

Try this first

What is the main purpose of a base case in a recursive algorithm?.

  1. A.To stop further recursive calls
  2. B.To make every recursive call use a different variable type
  3. C.To ensure the algorithm always repeats forever
  4. D.To replace the need for any general case

Answer and explanation

Concise answer

To stop further recursive calls

Why this is correct

The base case is the condition that is solved directly. When it is reached, the algorithm does not make another recursive call, so the recursion can finish.

Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions