10.1 Recursion
Enduring Understanding
Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values.
Learning Objective
Determine the result of executing recursive methods.
Essential Knowledge
A recursive method is a method that calls itself.
Recursive methods contain at least one base case, which halts the recursion, and at least one recursive call.
Each recursive call has its own set of local variables, including the formal parameters.
Parameter values capture the progress of a recursive process, much like loop control variable values capture the progress of a loop.
Any recursive solution can be replicated through the use of an iterative approach.
Exclusion Statement: Writing recursive program code is outside the scope of the course and AP Exam.
Recursion can be used to traverse String, array, and ArrayList objects.
Last updated
Was this helpful?