Skip to content · ⁨コンテンツへスキップ⁩
English

A function that calls itself

  • Recursion is when a function calls itself to solve a smaller version of the same problem.
  • It needs two parts: a base case that stops, and a recursive case that shrinks the problem.
  • Without a base case, it would call itself forever and crash.
日本語

自身を呼び出す関数

  • 再帰とは、関数が同じ問題のより小さなバージョンを解くために自分自身を呼び出すことです。
  • 2つの部分が必要です: 停止するためのベースケースと、問題を縮小する再帰ケース。
  • ベースケースがないと、無限に自分自身を呼び出してクラッシュします。

Handout · ⁨プリント⁩

Log in or create account · ⁨ログインまたはアカウント作成⁩

IGCSE, A-Level & AP