Skip to content · ⁨본문 바로가기⁩

Recursion: base case and recursive case · ⁨재귀: 기본 조건 및 재귀 조건⁩

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.
한국어

자신을 호출하는 메소드

  • 재귀는 같은 문제의 더 작은 부분을 해결하기 위해 메소드가 자신을 호출하는 것입니다.
  • AP CSA 시험에서는 주로 재귀를 추적합니다(손으로 호출을 따름). 작은 재귀 메소드를 작성하면 추적을 잘 할 수 있습니다.
  • 모든 재귀 메소드는 두 부분이 필요합니다: **기저 사례(base case)**와 재귀 사례(recursive case).

Handout · ⁨교재 자료⁩

Log in or create account · ⁨로그인 또는 계정 만들기⁩

IGCSE, A-Level & AP