# Question 1

Draw the box-and-pointer diagram for the linked list link after the following code is executed.

>>> link = Link(0)
for i in range(1, 3):
...


# Question 2

Write a function all_paths that takes in a Tree and returns a list of paths from the root to leaves. Each path is represented as a Link.

def all_paths(tree):


Toggle Solution

def all_paths(tree):
if tree.is_leaf():