Question
Develop and test two classes: a linked list-based stack ADT that implements the provided StackInterface.java a linked list-based queue ADT that implements the provided QueueInterface.java
Develop and test two classes:
- a linked list-based stack ADT that implements the provided StackInterface.java
- a linked list-based queue ADT that implements the provided QueueInterface.java
These implementations will be considered unbounded because of the use of a linked list for the underlying data structure.
The use of the attached generic singly linked list node class, LLNode.java, is recommended but not required.
Your stack and queue classes MUST be generic.
Please include a toString( ) method in each ADT.
----------
public class LLNode
public interface QueueInterface
void enqueue(E element); // add an element to the queue - always at the end of the queue E dequeue(); // remove and return the front of the queue boolean isEmpty(); boolean isFull(); } -----------------------------------
package interfaces;
public interface StackInterface
void push(E element); // add an element to the stack - always at the "top" E pop(); // remove and return the top of the stack E peek(); // return the top of the stack ... without removing boolean isEmpty(); boolean isFull(); }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started