Write a class MyArrayQueue that Inherit the ArrayBoundedQueue class show in screen shot and such that all the following methods are implemented in java: public String toString(); // Creates and returns a string that correctly represents the current queue. public void remove(int count); // Removes the front count elements from the queue. // Throw QueueUnderflowException with message of "Less than count elements in queue." //if there are less than count elements in the queue. public void reQueue(); // Dequeue an element from front, and enqueue the element back to rear of the queue. // Throw QueueUnderflowException with message of "No element in queue." // if there is no element in the queue. public void clear(); // Clear entire queue. public void reverse(); // Reverse queue content. Hint: you may use LinkedStack ADT. } public int space(); //return how many open spaces does the queue have still available.
Write a class MyArrayQueue that Inherit the ArrayBoundedQueue class show in screen shot and such that all the following methods are implemented in java:
public String toString();
// Creates and returns a string that correctly represents the current queue.
public void remove(int count);
// Removes the front count elements from the queue.
// Throw QueueUnderflowException with message of "Less than count elements in queue."
//if there are less than count elements in the queue.
public void reQueue();
// Dequeue an element from front, and enqueue the element back to rear of the queue.
// Throw QueueUnderflowException with message of "No element in queue."
// if there is no element in the queue.
public void clear();
// Clear entire queue.
public void reverse();
// Reverse queue content. Hint: you may use LinkedStack ADT.
}
public int space();
//return how many open spaces does the queue have still available.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps