Linked Lists: Difficult

Environment diagram

Draw the environment diagram for the following code.

lst = Link(1, Link(2, Link(3)))
def secret(lst):
    if lst is Link.empty:
        return lst
    else:
        lst.first = Link(lst.first)
        return Link(lst.first, secret(lst.rest)
lnk = secret(lst)

Code Writing

Write out a function that will take in two sorted linked lists and combine them into one sorted linked list (assume there are no duplicate values).
def merger(lnk1, lnk2):
>>> lnk1 = Link(1, Link(2, Link(5, Link(7))))
>>> lnk2 = Link(3, Link(6, Link(8, Link(9))))
>>> merger(lnk1, lnk2)
Link(1, Link(2, Link(3, Link(5, Link(6, Link(7, Link(8, Link(9))))))))
    if ______:
        return ______
    else if ______:
        return ______
    else if ______:
        return ______
    else:
        return ______