Question: Write anLLStack class that implementstheStack interface given below using alinked list rather than an array (as done in class).YourLLStack class should include all themethods in
Write an LLStack
public interfaceStack
{
// push an item onto the stack
void push(E element);
// pop an item from the stack (and return theitem)
E pop();
// return the item on top of the stack (withoutpopping)
E peek();
// returns whether the stack is empty
boolean isEmpty();
// returns the stack contents as astring
String toString();
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
