Give me some thoughts how to implement undo/redo functionality - like we have in text editors.
What algorithms should I use and what I may read. thanks.
Before implementing this yourself, note that this is quite common, and code already exist - For example, if you're coding in .Net, you can use IEditableObject.