you are createing an undo buffer that stores data modifications. you need to ensure that the undo functionality undoes the most recent data modifications first.you also need to ensure that the undo buffer permits the storage or strings only .
答案有两个
A Stack<string> undoBuffer = new Stack<string>();
A Queue<string> undoBuffer = new Queue<string>();
大概知道是考察队列和堆栈的知识的。 先进先出和先进后出。
A
考undo嘛,当然是先进后出,典型的栈结构,Stack .
you are createing an undo buffer that stores data modifications.
你正在创建一个用来保存数据修改的撤消缓冲存储器。
you
need to ensure that the undo functionality undoes the most recent data
modifications first.
你必须确定撤消操作是将最近修改的数据撤消(是stack)
you also need to ensure that the undo buffer permits
the storage or strings only .
你必须确定撤消缓冲存储器只允许保存字符串。
你需要建立一个可释放的缓冲区存储需要修改的数据,并且这个缓冲区,还要允许相应的方法能获取到最新的要修改的数据以及保证能存储对象和字符串。
storage这里应该是用来表明要存储对象的。
you are createing an undo buffer that stores data modifications.
你正在创建一个撤消存储数据更正的缓冲。
you need to ensure that the undo functionality undoes the most recent data modifications first.
首先,你必须保证那个撤消方法是撤消最近的数据更改。
you also need to ensure that the undo buffer permits the storage or strings only .
你也必须保证撤消缓冲只允许存储或字符串。
上来学习一下.
A
就是要你实现一个撤销的功能,undo,也就是word里面经常点的那两弯弯的小箭头。
可以返回到上一个状态,经常用ctrl+z也可以实现。
你需要一个容器来存储每次的状态,容器返回的应该是上一次的状态,明显的是“后进先出”
用栈存储所有的状态,