Question: PROBLEM: . void CBQueue::enqueue(string s) : This method adds a new node containing string s to the rear of the queue. EXISTING CODE: #include CBQueue.h

PROBLEM:

. void CBQueue::enqueue(string s) : This method adds a new node containing string s to the rear of the queue.

EXISTING CODE:

#include "CBQueue.h"

CBQueue::CBQueue()

{

front = NULL;

rear = NULL;

size = 0;

}

//Returns elements in CBQuene

int CBQueue::getSize( ){

return size;

}

//return whether the queue is empty or not

bool CBQueue::isEmpty( ){

if(front == NULL)}{

return true;

}

else{

return false;

}

void CBQueue::enqueue(string s){

}

}

CBQueue.h

#include // this allows you to declare and use strings

#include

using namespace std;

struct qNode

{

string data;

qNode* next;

qNode* prev;

};

class CBQueue

{

public:

CBQueue();

int CBQueue::getSize( );

bool CBQueue::isEmpty( );

private:

qNode* front;

qNode* rear;

int size;

};

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!