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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!