Command executor with undo
Implement a class that executes commands and can undo them: execute(command) applies it and records it, and undo() reverts the most recent command that has not been undone. Decide how a command knows how to reverse itself, then discuss redo, undoing several steps, and the time and memory each operation costs.
No answer yet. Write the first one; the best answer gets endorsed.
