2023 modify the Queue cpp file by implementing the details for the predicate function called isEqual which | Assignment Collections

Computer Science 2023 Modify The Queue.cpp File By Implementing

2023 modify the Queue cpp file by implementing the details for the predicate function called isEqual which | Assignment Collections

modify the Queue.cpp file by implementing
the details for the predicate function called isEqual(), which will take in two queues as parameters and will determine if they are equal. The prototype for this function is as follows:
template
void isEqual(queue &Q1, queue &Q1);
Note: The implementation should use while-loops and not a single line consisting of the built in equality operator.
Hint: Again, you only need to modify the areas in the Queue.cpp file by adding the necessary code to implement the TODO areas as noted in the comments. The prototype for the function and everything else in the program will remain unchanged. You must use the function signature for your implementation. Use two while-loops embedded within each other. Check if each item in the first queue is also in the second queue. If it is then set the equal variable to true.
Output: The output for the program after the function is implemented should appear as follows:
Queue 1: 10 30 20 40
Queue 2: 20 30 10 40
Queue 3: 10 30 20 40
3
Queue 4: 10 30 20 40 51
Q1 equals Q2=0
Q1 equals Q3=1
Q1 equals Q4=0
Q2 equals Q3=0
Q2 equals Q4=0
Q3 equals Q4=0
** Press any key to continue **
THE QUEUE.CPP FILE THAT NEEDS TO BE MODIFIED BELOW:
/**
* Queue.cpp – This program implements and tests the
* isEqual() predicate funciton.
*
* TODO: Include your name and course number here.
*
*/
#include
#include
#include
using namespace std;
template
void print(queue Q);
template
bool isEqual(queue Q1, queue Q2);
int main(int argc, char **argv)
{
bool equal = false;
// Declare queue variables
queue Q1;
queue Q2;
queue Q3;
queue Q4;
// Add some data to queue 1
Q1.push(10);
Q1.push(30);
Q1.push(20);
Q1.push(40);
// Add some data to queue 2
Q2.push(20);
Q2.push(30);
Q2.push(10);
Q2.push(40);
// Add some data to queue 1
Q3.push(10);
Q3.push(30);
Q3.push(20);
Q3.push(40);
// Add some data to queue 4
Q4.push(10);
Q4.push(30);
Q4.push(20);
Q4.push(40);
Q4.push(51);
cout << “Queue 1: “;
print(Q1);
cout << “Queue 2: “;
print(Q2);
cout << “Queue 3: “;
print(Q3);
cout << “Queue 4: “;
print(Q4);
equal = isEqual(Q1, Q2);
cout << “Q1 equals Q2=” << equal << endl;
equal = isEqual(Q1, Q3);
cout << “Q1 equals Q3=” << equal << endl;
equal = isEqual(Q1, Q4);
cout << “Q1 equals Q4=” << equal << endl;
equal = isEqual(Q2, Q3);
cout << “Q2 equals Q3=” << equal << endl;
equal = isEqual(Q2, Q4);
cout << “Q2 equals Q4=” << equal << endl;
equal = isEqual(Q3, Q4);
cout << “Q3 equals Q4=” << equal << endl;
cout << “n** Press any key to continue **n”;
getchar();
return 0;
}
template
void print(queue Q)
{
// queue tmpQueue = Q;
Object tmpItem;
while (!Q.empty())
{
tmpItem = Q.front();
cout << ” ” << tmpItem;
Q.pop();
}
cout << endl;
return;
}
template
bool isEqual(queue Q1, queue Q2)
{
bool equal = false;
// TODO: Implement the detail of the funciton here.
return equal;
}

 

 

 

We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.

Place Order Now

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational