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
#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
Get step-by-step solutions from verified subject matter experts
