Domanda di colloquio di Jet

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

Risposta di colloquio

Anonimo

18 lug 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.