Question discussion

A text editor supports undo and redo operations. Which data structure is the most suitable to implement them?

1922Medium DSSSB TGT Computer Science 0 replies

A text editor supports undo and redo operations. Which data structure is the most suitable to implement them?

  • ATwo stacks
  • BA single queue
  • CA binary search tree
  • DA hash table
Correct answer: A

Explanation

Actions are pushed onto an undo stack; undoing pops an action and pushes it onto the redo stack, and vice versa.

Discussion 0

Nobody has replied yet. Start the discussion!