1. PPT Reference:
https://drive.google.com/file/d/0B8J8S-phorS-Q2lzQXY3UGYwcFE/view?usp=sharing
2. A problem of calculating triangle areas by counting ([ ]=1):
[ ]
[ ] [ ]
[ ] [ ] [ ]
[ ] [ ] [ ] [ ]
3. A problem of calculating 120!:
120! = 120 * 119!; 119! = 119* 118!; ......, 2! = 2*1!, 1!=1;
4. There is a way of calculation / solving problems:
find the relationship between f(x) and f(x-1)
to solve a big problem such as f(20), reduce it to f(19), f(18), f(17), ......, f(2), f(1), f(0)...
f(0) or f(1) should be easy to figure out
then propagate back to f(2), f(3), ......, f(19), f(20)
5. Recursion has two elements:
A pattern to go from f(x-1) to f(x), or vice versa.
An ending condition/value which is the most simple case.
6. Of course it's always easy said than done, so here is your challenge. Please solve the two recursive functions and figure out "What does this program do". Whoever gets 3 correct answers will be honorably mentioned :).
https://drive.google.com/open?id=0B8J8S-phorS-VlE3bGpfeExMelE
1) Seventy Nien
2) six
3) ???
5) A= 5 B= 6 C= 5 D= 12
2) 6
1)44
1. 79
2. 5
3. I'm confused.
4. B, A, C, D
5. A: 5 B. 6 C. 3 D. 2
1) 79
2)6
3)345
1.79 2.6 3. RIP I don't know my binary code 4.I Still don't know my binary code 5. A.5 B. 6 C.5 D.12
1. 79
2. 6
5. 5,6,5,12