Question: Use JAVASCRIPT. Thank You very much. Implement a queue using a circular array as discussed in class. Make your queue size 5. Queue() creates an

Use JAVASCRIPT. Thank You very much.
Implement a queue using a circular array as discussed in class. Make your queue size 5. Queue() creates an empty queue, queue is new and empty. enqueue(item) adds a new item to the queue, queue is modified. Dequeue() removes and returns an item, queue is modified. isEmpty() returns a boolean and tests for an empty queue, queue is not modified. size() returns the int size of the queue, queue is not modified print() prints the queue from front to rear, queue is not modified. Peek() prints the front element, queue is not modified. Driver should print the results of the following enqueue("dog") enqueue("cat") enqueue("mouse") enqueue("pig") enqueue("bird") size() enqueue("puppy") size() dequeue() dequeue() size() dequeue() peek() dequeue() dequeue() size() isEmpty()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
