Pergunta de entrevista da empresa Jet

Describe how you would implement Undo, Redo in a text editor

Resposta da entrevista

Sigiloso

18 de jul. de 2016

Using a Linked List that stores each typed chars as an item in the list. Every item would have a reference the previous item and the next item. A separate variable would have the reference to the current item representing the current state. When redo or undo command is called the current state would move to previous or next.