代码学习
未读数据结构和算法分析(Data Structures and Algorithm Analysis) 的第一节课是回顾之前所学的递归(Recursion),作为导入课的同时还可以简单复习一下 java(这门课所使用语言)。因此第一周的课程和 lab 不算难,以下是 Lab 的具体细节。
Lab 1题目 1
Read in a positive number and compute its factorial using recursion.
Note that your class should be named “T1”, and should contain
a main function, which does IO
and a recursive function, public static int factR(int n), which computes the factorial
You may build you recursion as follows.
Step, if n>1: factR(n) = n * factR(n-1)
Base, if n< ...



