Question: How can I do this in java? E undo(): if the undo stack is not empty, pop the top element off of the undo stack,

How can I do this in java?

  • E undo(): if the undo stack is not empty, pop the top element off of the undo stack, push it onto the redo stack, and return the element. Otherwise, return null.
  • E redo(): if the redo stack is not empty, pop the top element off of the redo stack, push it onto the undo stack, and return the element. Otherwise, return null.

public class DynamicNavStack //class name

private E[] navStack; //stack name

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!