Question: Note: I am coding in C++. All 4 functions above come with empty parameters other than enqueue, in which the parameter is as follows: (int
Note: I am coding in C++. All 4 functions above come with empty parameters other than enqueue, in which the parameter is as follows: (int value).
The Problem Create a class Queue. The queue should be implemented with a dynamically allocated linked list (you may want to make a listnode struct/class within Queue Implement the following member functions of the queue class: int getSize returns the number of elements in the queue (0 if empty) bool isEmpty() returns if the list has no elements, else false void enqueue puts an item to the queue in O(1) time int dequeue removes an item off the queue and returns the value in O(1) time
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
