Lab 7 - Midterm review
HOF, Recursion, Trees, Sequences & Mutability
Q3: Insect Combinatorics
def paths(m, n):
"""Return the number of paths from one corner of an
M by N grid to the opposite corner.
>>> paths(2, 2)
2
>>> paths(5, 7)
210
>>> paths(117, 1)
1
>>> paths(1, 157)
1
"""
"*** YOUR CODE HERE ***"
Q3: Solution
Q4: Number of Trees
Q4: Solution
Q5: Pruning Leaves
Q5: Solution
Last updated