- Draw the box-and-pointer diagram for the linked list
linkafter the following code is executed.
>>> link = Link(0) for i in range(1, 3): ... link = Link(i, Link(link, link)) ... >>> link.rest.rest.rest = link.rest
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
def all_paths(tree): """YOUR CODE HERE."""