Question: Objective Using the skeleton class UnSortedPriorityQueueQueue provided, implement a queue abstract data type using only an unsorted priority queue and one additional integer instance variable.
Objective
Using the skeleton class UnSortedPriorityQueueQueue provided, implement a queue abstract data
type using only an unsorted priority queue and one additional integer instance variable. Analyze the BigO runtime of your implementation of the enqueue and dequeue methods.
Requirements
Your solution should use the textbook net.datastructures.UnSortedPriorityQueue
Skeleton classes and JUnit test cases are provided to support your implementation. These
skeletons should be implemented however additional methods may be required.
Implement proper error handling
The BigO runtime of the enqueue and dequeue should be indicated in the code comments
Points
Points Method
public UnSortedPriorityQueueQueue constructor and body
public void enqueueV value
point for BigO analysis
public V dequeue
point for BigO analysis
public V first
public int size
public b
import net.datastructures.UnsortedPriorityQueue;
An implementation of a queue using the an unsorted priority queue
@param The type of content held in the queue
public class UnSortedPriorityQueueQueue
You complete me
Construct an initially empty queue
public UnSortedPriorityQueueQueue
You complete me
Enqueue value onto the queue
BigO analysis: You complete me
@param value The element to be pushed on to the queue
public void enqueueV value
You complete me
Remove the oldest element from the queue
BigO analysis: You complete me
@return The first element that was added to the queue.
public V dequeue
You complete me
Look at but do not remove the oldest element from the queue
@return The first element that was added to the queue.
public V first
You complete me
@return The size of the stack
public int size
You complete me
@return True if the stack is empty. False otherwise.
public boolean isEmpty
You complete me
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
