Can someone help me with C++? I have to implement the queue linked list. //////////////////////////////////////////// driver.cpp //////////////////////////////////////////// //////////Test code for queue /////////// #include #include #include "stackLL.h" #include "queueLL.h" #include "priorityQueueLL.h" using namespace std; int main() { queueLL Q; Q.enqueue(1); Q.enqueue(2); Q.enqueue(3); cout << "Dequeuing: " << Q.dequeue() << endl; //1 cout << "Dequeuing: " << Q.dequeue() << endl; //2 Q.enqueue(4); Q.enqueue(5); //3 4 5 while (!Q.empty()) { cout << "Dequeuing: " << Q.dequeue() << endl; } //////////////////////////////////////////// queueLL.h //////////////////////////////////////////// class queueLL { private: //put what you need here... public: queueLL() {} ~queueLL() {} //add item to back of queue void enqueue(int x) {} //remove and return first item from queue int dequeue() {} //For the final part of the test program, template this class //and add a decimate method. }
Can someone help me with C++? I have to implement the queue linked list.
////////////////////////////////////////////
driver.cpp
////////////////////////////////////////////
//////////Test code for queue ///////////
#include <iostream>
#include <string>
#include "stackLL.h"
#include "queueLL.h"
#include "priorityQueueLL.h"
using namespace std;
int main()
{
queueLL Q;
Q.enqueue(1);
Q.enqueue(2);
Q.enqueue(3);
cout << "Dequeuing: " << Q.dequeue() << endl; //1
cout << "Dequeuing: " << Q.dequeue() << endl; //2
Q.enqueue(4);
Q.enqueue(5);
//3 4 5
while (!Q.empty())
{
cout << "Dequeuing: " << Q.dequeue() << endl;
}
////////////////////////////////////////////
queueLL.h
////////////////////////////////////////////
class queueLL
{
private:
//put what you need here...
public:
queueLL()
{}
~queueLL()
{}
//add item to back of queue
void enqueue(int x)
{}
//remove and return first item from queue
int dequeue()
{}
//For the final part of the test program, template this class
//and add a decimate method.
}
The solution to the given problem is below.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images