Question: Develop and test two classes: an array-based stack ADT that implements the provided StackInterface.java an array-based queue ADT that implements the provided QueueInterface.java You must

 Develop and test two classes: an array-based stack ADT that implements

Develop and test two classes:

an array-based stack ADT that implements the provided StackInterface.java

an array-based queue ADT that implements the provided QueueInterface.java

You must also develop a single test program that verifies all of the operations for each of the ADT classes.

Please include a toString( ) method in each ADT.

package stackInterface;

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();

}

package queueInterface;

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();

}

Except for the self-service registers, each cash register in a typical grocery store has its own line of customers waiting to be rung up' and pay. Whenever a shopper is done shopping, they must pick a line, or queue, to get on and hope they have picked one where their fellow customers ahead of them will be served quickly. Many banks set up a single queue for all customers to wait in before being helped by the next available teller. Which of these arrangements-multiple servers with multiple queues or multiple servers with a single queue - will result in the lowest average waiting time? To answer that question, develop a Java program that runs a simulation of each arrangement serving the same set of randomly generated customers

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!