3. 递归¶
3.1. 目标¶
完成本模块后,学生将能够:
跟踪递归方法
实现递归方法
评估递归方法的效率
3.1.1. 建议阅读¶
第 7 章,来自 Data Structures and Abstractions with Java(第 4 版),Frank M. Carrano 和 Timothy Henry 著
3.2. 递归简介¶
3.2.1. 递归简介(第 1 部分)¶
3.2.2. 递归简介(第 2 部分)¶
3.3. 检查点 1¶
3.4. 交互式:更多递归:阶乘示例¶
3.5. 编程练习:递归 1¶
3.6. 交互式:数组上的递归:显示数组¶
更正说明(Correction to note!)
本视频中第二个示例的代码在 if 块中缺少 {} 。它应该是:
public static void displayArray2(int[] array, int first, int last)
{
if (first <= last) {
displayArray2(array, first, last - 1);
System.out.print(array[last] + " ");
}
}
