I am looking to do it with Python. And I don\'t want to just print it in reverse, but actually reverse the given nodes. I have seen it done in other languages but had trouble fi
def reverse_list(self,node):
if node is None:
return //list is empty
elif node.next is None:
self.head = node // changing the head to last node after reversal
return
else:
reverse_list(node.next) //call the function recursively until the end of the list
node.next.next = node //reverse the link
node.next = None