def reverse_list_recursive(head):
if head is None or head.next is None:<EOL><INDENT>return head<EOL><DEDENT>p = head.next<EOL>head.next = None<EOL>revrest = reverse_list_recursive(p)<EOL>p.next = head<EOL>return revrest<EOL>
:type head: ListNode
:rtype: ListNode