Question: Suppose you are asked to implement a queue class. The header file for the queue class is provided to you as follows. class Oqueue {
Suppose you are asked to implement a queue class. The header file for the queue class is provided to you as follows. class Oqueue { public: Qqueue int cap); Qqueue const Qqueue&s); -Qqueue(); //destructor void enqueue (const std::string& s); std::string dequeue 0: std::string& getfront const; std::string& getback () const; bool IsEmpty const; void print) const; int size() const; int getCapacity const; private: int Capacity; // Capacity is the maximum number of items that a queue can hold std::string* DynamicQueue; int num; // How many items are stored in the queue int front; int back; 3: (1). (4 points) Suppose the code for the constructor is as follows, Oqueue::Qqueue int cap) Capacity - cap: DynamicQueue - new string[cap]: num-0 front-0; back 0; Please provide the code for the destructor for this queue class
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
