Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Implementation

Authors: Shouhong Wang, Hai Wang

1st Edition

1612330150, 978-1612330150

More Books

Students also viewed these Databases questions

Question

How does collateral impact the price of a bond?

Answered: 1 week ago