Pular para o conteúdo

Recursão: caso base e caso recursivo

English

A method that calls itself

  • Recursion is when a method calls itself to solve a smaller piece of the same problem.
  • On the AP CSA exam you mostly trace recursion (follow the calls by hand). Writing small recursive methods helps you trace well.
  • Every recursive method needs two parts: a base case and a recursive case.

Material de apoio

Entrar ou criar conta

IGCSE, A-Level & AP