This keeps rest part of list intact .
if ( count == n ) : NEW_LINE INDENT d = c . next NEW_LINE c . next = link NEW_LINE end . next = d NEW_LINE head = A NEW_LINE while ( head != None ) : NEW_LINE INDENT print ( head . data , end = " ▁ " ) NEW_LINE head = head . next NEW_LINE DEDENT return NEW_LINE DEDENT c = c . next NEW_LINE