Question: Task: Develop a program that initialize an integer queue (values between 1 and100) and then remove keys where key = 17 and then print the
Task:
Develop a program that initialize an integer queue (values between 1 and100) and then remove keys where key = 17 and then print the queue.
Your main function may look like:
#include
#include
#include
#include
using namespace std;
template
void remove_keys( queue
int main()
{
queue
int i, temp;
srand(time(NULL));//set a seed for random number generator
for( i = 0; i < 100; i++)
{
temp = rand()%100+1;
q.push(temp); //push an item onto the queue
cout< } remove_keys(q, 17); while( !q.empty()) { cout< q.pop(); } cout< return 0; } The programming Language is C++
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
