Question: Provide a similar generic queue interface named Queue . Provide a linked generic queue named LinkedQueue that implements the interface Queue using the head-and-tail approach.

 Provide a similar generic queue interface named Queue. Provide a linked

Provide a similar generic queue interface named Queue.

Provide a linked generic queue named LinkedQueue that implements the interface Queue using the head-and-tail approach.

Write a JUnit test program QueueTest for your generic queue implementation. Make sure that you are using at least two parameter types (e.g. Integer and String) in your tests.

You are of course allowed to reuse your own non-generic queue implementation/test from Assignment 1.

public interface IntQueue extends Iterable { public int size(); // current queue size public boolean is Empty(); // true if queue is empty public void enqueue(int element); // add element at end of queue public int dequeue(); // return and remove first element. public int first(); // return (without removing) first element public int last(); // return (without removing) last element public String toString(); // return a string representation of the queue content

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!