Question: Here is an example of a basic implementation file of a queue (NOT a dynamic implementation). If I were to implement a dynamic queue class
Here is an example of a basic implementation file of a queue (NOT a dynamic implementation).
If I were to implement a dynamic queue class for the function enqueue, how would I do it?
Please write the pseudo code for dynamic queue class's enqueue function.


class Basic_int_queue public: // This part should be implementation independent. Basic_int_queue / constructor void enqueue int item)i int dequeue) int front(); bool empty) int size()i private: // This part is implementation-dependant. int capacity /7 this will be the size of the array int *A; // this is a pointer to the array int front_index i I/ index in A of current front item (if queue is not empty) int rear_index I/ index in A where next item enqueued will go. int current size // current number of elements in the queue class Basic_int_queue public: // This part should be implementation independent. Basic_int_queue / constructor void enqueue int item)i int dequeue) int front(); bool empty) int size()i private: // This part is implementation-dependant. int capacity /7 this will be the size of the array int *A; // this is a pointer to the array int front_index i I/ index in A of current front item (if queue is not empty) int rear_index I/ index in A where next item enqueued will go. int current size // current number of elements in the queue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
