Question: Implement the QueueADT interface from earlier this semester using the LinkedHeap implementation from the Java Foundations book. Call your class HeapQueue and include it in

Implement the QueueADT interface from earlier this semester using the LinkedHeap implementation from the Java Foundations book. Call your class HeapQueue and include it in the jsjf package. You must use a heap to implement a queue to receive credit for this part of the assignment.

package jsjf;

/**

* QueueADT defines the interface to a queue collection.

*

* @author Java Foundation

* @version 4.0

*/

public interface QueueADT

{

/**

* Adds one element to the rear of this queue.

* @param element the element to be added to the rear of the queue

*/

public void enqueue(T element);

/**

* Removes and returns the element at the front of this queue.

* @return the element at the front of the queue

*/

public T dequeue();

/**

* Returns without removing the element at the front of this queue.

* @return the first element in the queue

*/

public T first();

/**

* Returns true if this queue contains no elements.

* @return true if this queue is empty

*/

public boolean isEmpty();

/**

* Returns the number of elements in this queue.

* @return the integer representation of the size of the queue

*/

public int size();

/**

* Returns a string representation of this queue.

* @return the string representation of the queue

*/

public String toString();

}

: Create a driver called HeapDriver.java to test your implementation. Add the words of the sentence This is my heaps project for CSC205 individually to the following data structures:

a min heap a HeapStack a HeapQueue

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!