from structures import build_list, list_values

def reverse_list(head):
    previous, current = None, head
    while current is not None:
        following = current.next
        current.next = previous
        previous = current
        current = following
    return previous
