Which data structure is most appropriate to use for implementing an undo/redo functionality in a text editor?
Correct: B
A stack is the best choice for implementing undo/redo functionality. Each action is pushed onto the stack. To undo, the top action is popped from the stack and reversed. To redo, the undone action is pushed back onto the stack. This LIFO (Last-In-First-Out) behavior perfectly matches the undo/redo process.