10 Recursion
5 - 7.5% Exam Weight
What is the base case?
side length < 2cm → done
What is the pattern?
draw a triangle using midpoints of the sides (make a triforce)
then make a sierpinski triangle in the top triangle
then make a sierpinski triangle in the right triangle
then make a sierpinski triangle in the left triangle
Factorial
Factorial
What is the base case?
0! → 1
What is the pattern?
Multiply current number by the factorial of the next smaller number.
Reverse a String
Reverse a String
What is the base case?
The reverse of an empty String is and empty String
What is the pattern?
Concatenate the last letter by the reverse of all the letters before it.
Mystery1
Mystery1
What is the base case?
What is the pattern?
Mystery2
Mystery2
What is the base case?
What is the pattern?
10.01 - Recursion - AP
10.01 - Recursion - AP
10.01 - Recursion - thenewboston
10.01 - Recursion - thenewboston
10.02 - Recursive Searching and Sorting [Part 1] - AP
10.02 - Recursive Searching and Sorting [Part 1] - AP
10.02 - Recursive Searching and Sorting [Part 2] - AP
10.02 - Recursive Searching and Sorting [Part 2] - AP