Function to reverse the linked list using 2 pointers
def reverse ( head_ref ) : NEW_LINE INDENT current = head_ref NEW_LINE next = None NEW_LINE while ( current . next != None ) : NEW_LINE INDENT next = current . next NEW_LINE current . next = next . next NEW_LINE next . next = ( head_ref ) NEW_LINE head_ref = next NEW_LINE DEDENT return head_ref NEW_LINE DEDENT