Recursion Flashcards
1
Q
An example to introduce Recursion;
A
2
Q
Recursion : Fibonacci
A
3
Q
Recursion : Sum (basic condition & array)
A
4
Q
Recursion : find max in array
A
N = index of array (which is the biggest numbers of elements in the array)
5
Q
Recursion : Hanoi
Hint:
1. n == how many layers
2.A means from where
3.B means cross where
4.C means destination
输入函数的n表示A一开始的层数,但是在每次递归中n表示A的第n层的东西怎么移动。
A
Move : 产生移动从第二个参数到第四个参数
6
Q
Recursion : find_max from left to right index in array
A
7
Q
Recursion : sum in array (from left to right)
A
8
Q
Recursion : Bubble
A
9
Q
Recursion : 找到最小公倍数
A