Write the definition of the class linkedQueueType, which is derived from the class unorderedLinkedList. write a program to test various operations of this class. Following are code template. Please provide input and output screen shot. (ref:C++ by D.S. Malik. pages 495 Programming Exercise # 7)
?? The language is c++, please take a screenshot of your output.
Write the definition of the class linkedQueueType, which is derived from the class unorderedLinkedList. write a program to test various operations of this class. Following are code template. Please provide input and output screen shot. (ref:C++ by D.S. Malik. pages 495
//Program to test the queue operations
#include <iostream>
#include "queueLinked.h"
using namespace std;
int main()
{
linkedQueueType<int> queue;
linkedQueueType<int> copyQueue;
int num;
cout << "Queue Operations" << endl;
cout << "Enter numbers ending with -999" << endl;
cin >> num;
while (num != -999)
{
// queue.addQueue(num); //add an element to the queue
cin >> num;
}
copyQueue = queue; //copy queue into copyQueue
cout << "queue: ";
// while (!queue.isEmptyQueue())
// {
// cout << queue.front() << " ";
// queue.deleteQueue();
// }
cout << endl;
// cout << "copyQueue: ";
// while (!copyQueue.isEmptyQueue())
// {
// cout << copyQueue.front() << " ";
// copyQueue.deleteQueue();
// }
cout << endl;
return 0;
}
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images