"Suggerisci un algoritmo per invertire una lista concatenata."
def reverse_list(head):
    prev = None
    curr = head
    
    while curr is not None:
        next_node = curr.next
        curr.next = prev
        prev = curr
        curr = next_node
    
    head = prev
    return head

Traduci il seguente testo in italiano: 'def reverse_list(head):
    prev = None
    curr = head
    
    while curr is not None:
        next_node = curr.next
        curr.next = prev
        prev = curr
        curr = next_node
    
    head = prev
    return head'