Recursion 1
From Huben's Wiki
(Created page with "Recursion is one of the major tools of computing. (Iteration is another, and the next.) '''Recursion''' means a method calls itself as part of solving a problem. If all a meth...") |
|||
Line 17: | Line 17: | ||
* How do these parts apply to the Sierpinski's Triangle exercise? | * How do these parts apply to the Sierpinski's Triangle exercise? | ||
+ | |||
+ | Handout 2: Describing Recursive methods | ||
+ | |||
+ | * Do the first 3. | ||
+ | * Mark these 4 things on the handout. | ||
+ | # Draw an arrow to the test that determines whether recursion stops or continues. | ||
+ | # Write how the problem is divided into smaller parts. | ||
+ | # Underline the recursive call. | ||
+ | # Draw arrows to where the results are combined and returned. | ||
+ | |||
+ | Handout 3: Tracing Recursion | ||
+ | |||
+ | * Do the first 3. | ||
+ | * Build the call stack upwards, then bring the returns downwards |