0

I have written a program that does many different things with a linked list. it asks for the user to enter different lines of text to the linked list. They can either enter the line at the end of the list of at a random line number. Or they can delete a line. But now I need to write a function or two that when called upon will undo or redo the last command and it can undo or redo up to 10 commands in a row. Any ideas about what is the best way to go about undoing commands involving linked lists?

1 Answers1

0

You need to store a history of commands in a list. To undo, look at the most recent command and reverse its action.

Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268