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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started