9.1. Recursion¶
9.1.1. Objectives¶
Upon completion of this module, students will be able to:
Trace recursive methods
Implement recursive methods
Consider the efficiency of recursive methods
9.1.1.1. Suggested Reading¶
Chapter 7 from Data Structures and Abstractions with Java, 4th edition by Frank M. Carrano and Timothy Henry
9.1.2. Introduction to Recursion¶
9.1.2.1. [5:53] Intro to Recursion Video, Part 1 of 2¶
9.1.2.3. Checkpoint 1¶
9.1.4. Programming Practice: Recursion 1¶
9.1.5. Recursion on Arrays¶
9.1.5.1. [13:30] Display Arrays Video¶
Correction to note! The code in the second example of this video is
missing {}
in the if block. It should be:
public static void displayArray2(int[] array, int first, int last)
{
if (first <= last) {
displayArray2(array, first, last - 1);
System.out.print(array[last] + " ");
}
}
TODO: fix URLS.