CS 111 - 4/1/14
Exam 2 - in lecture Thursday 4/10/14
For the exam, be able to figure out code
similar to:
z = 0;
for (x = 0; x < 4 ; x++)
{
for (y = 0 ; y < 4; y++)
{
z = z + x + y;
}
}
Recursion - A method that calls itself
fib(1) = 1
fib(2) = 1
fib(n) = fib(n-1) + fib(n-2)
x^0 = 1
x^Y = x * x^(y-1)
fact (1) = 1
fact (n) = n * fact(n-1)