Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save onelharrison/5b38ad9902e26e3c3eac521eb4c6f49d to your computer and use it in GitHub Desktop.

Select an option

Save onelharrison/5b38ad9902e26e3c3eac521eb4c6f49d to your computer and use it in GitHub Desktop.
Compact increment of a recursive function that reverses a 0- and 1-node linked list
def reverse_linked_list_recursive(head):
if head is None or head.next_node is None:
return head
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment