Given the following definition of a queue data structure implemented using a circular array. Assume all methods but the isFull function have been properly implemented. As a reminder, a queue supports First In First Out. The constructor requests n array slots from the heap and initialize the data members. The destructor releases the array slots back to the heap. • The push function adds a new element to the queue. The pop function removes the oldest element of the queue. ● class CircularArrayQueue: public Queue { private: int* arr_; //an array to hold all elements of the queue unsigned capacity_; //the maximum number of slots in the array int front_; //index for the oldest, front element in the queue int rear_; //index for the newest, rear elements in the queue public: CircularArrayQueue (unsigned n) ; ~CircularArrayQueue (); bool isFull() const; void push (const string& val); void pop(); In the following space, implement the is Full member function to return true if the queue is full and cannot take any new element. The function shall return false otherwise. The implementation must be of an O(1) time complexity. No loop is allowed.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Help please its in C++ 

Given the following definition of a queue data structure implemented using a
circular array. Assume all methods but the isFull function have been properly implemented.
As a reminder, a queue supports First In First Out.
The constructor requests n array slots from the heap and initialize the data members.
The destructor releases the array slots back to the heap.
The push function adds a new element to the queue.
The pop function removes the oldest element of the queue.
●
●
●
●
class CircularArrayQueue: public Queue {
private:
int* arr_
//an array to hold all elements of the queue
unsigned capacity_; //the maximum number of slots in the array
int front; //index for the oldest, front element in the queue
//index for the newest, rear elements in the queue
int rear_;
public:
CircularArray Queue (unsigned n) ;
~CircularArrayQueue ();
bool isFull() const;
void push (const string& val);
void pop();
In the following space, implement the is Full member function to return true if the queue is full
and cannot take any new element. The function shall return false otherwise. The implementation
must be of an O(1) time complexity. No loop is allowed.
Transcribed Image Text:Given the following definition of a queue data structure implemented using a circular array. Assume all methods but the isFull function have been properly implemented. As a reminder, a queue supports First In First Out. The constructor requests n array slots from the heap and initialize the data members. The destructor releases the array slots back to the heap. The push function adds a new element to the queue. The pop function removes the oldest element of the queue. ● ● ● ● class CircularArrayQueue: public Queue { private: int* arr_ //an array to hold all elements of the queue unsigned capacity_; //the maximum number of slots in the array int front; //index for the oldest, front element in the queue //index for the newest, rear elements in the queue int rear_; public: CircularArray Queue (unsigned n) ; ~CircularArrayQueue (); bool isFull() const; void push (const string& val); void pop(); In the following space, implement the is Full member function to return true if the queue is full and cannot take any new element. The function shall return false otherwise. The implementation must be of an O(1) time complexity. No loop is allowed.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY