Driver Code
if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT root = newNode ( 5 ) NEW_LINE root . next = newNode ( 2 ) NEW_LINE root . next . next = newNode ( 2 ) NEW_LINE root . next . next . next = newNode ( 7 ) NEW_LINE root . next . next . next . next = newNode ( 2 ) NEW_LINE root . next . next . next . next . next = newNode ( 2 ) NEW_LINE root . next . next . next . next . next . next = newNode ( 2 ) NEW_LINE key = 2 NEW_LINE print ( " Linked ▁ List ▁ before ▁ operations ▁ : " ) NEW_LINE printList ( root ) NEW_LINE print ( " Linked ▁ List ▁ after ▁ operations ▁ : " ) NEW_LINE root = keyToEnd ( root , key ) NEW_LINE printList ( root ) NEW_LINE DEDENT