7.2. Recursion¶
7.2.1. Objectives¶
Upon completion of this module, students will be able to:
Trace recursive methods
Implement recursive methods
Consider the efficiency of recursive methods
7.2.1.1. Suggested Reading¶
Chapter 7 from Data Structures and Abstractions with Java, 4th edition by Frank M. Carrano and Timothy Henry
7.2.3. Checkpoint 1¶
7.2.5. Programming Practice: Recursion 1¶
7.2.6. Interactive: Recursion on Arrays: Display an Array [13:30]¶
Correction to note!
The code in the second example in this video is missing the {}
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] + " ");
}
}

7.2.7. Checkpoint 2¶
7.2.8. Interactive: Recursion on Arrays: Display the Middle of an Array [9:53]¶
