Refer to the figure above assume you add the numbers 23 76


Question 1

Refer to the figure above. Which of the following members in the UML diagram adds an element to the front of the queue?

1. front

2. addQueue

3. back

4. None of the above

Question 2

An effective way to implement a priority queue is to use a(n) ____ structure.

1. stack

2. array

3. varied

4. treelike

Question 3

//Program to test the queue operations
#include
#include "linkedList.h"
#include "queueLinked.h"

using namespace std;

int main()
{
linkedQueueType queue;
linkedQueueType copyQueue;

int num;

cout<<"Queue Operations"< cout<<"Enter numbers ending with -999"< cin>>num;

while(num != -999)
{
queue.addQueue(num); //add an element to the queue
cin>>num;
}

copyQueue = queue; //copy the queue into copyQueue

cout<<"Queue contains: ";
while(!copyQueue.isEmptyQueue())
{
cout< copyQueue.deleteQueue(); //remove an element from
//the queue
}

cout<
return 0;
}

Question 4

Based on the figure above, if you wanted to print out the contents of copyQueue in reverse order, which statement would do the job?

1. cout<
2. cout<
3. cout<
4. cout<

Question 5

One way to implement a priority queue is to use an ordinary ____.

1. linked-list

2. array

3. stack

4. list

Question 6

FIFO closely resembles which of the following?

1. the order in which print jobs of the same priority are executed by a printer

2. the order in which customers are serviced in a bank

3. the order in which shoppers are serviced on line to pay for their items

4. All of the above

Question 7

Refer to the figure above. Which of the following members in the UML diagram keeps track of the number of elements in a queue at a given point in time?

1. maxQueueSize

2. isFullQueue

3. count

4. num

Question 8

The function destroyQueue does which of the following?

1. uses one queue to delete another

2. deletes all instances of the queue

3. copies the queue into backup memory

4. removes all elements from the queue leaving an empty queue

Question 9

In a queuing system the time it takes for the server to serve the customer is known as the ____ time.

1. initiation

2. transaction

3. response

4. wait

Question 10

//Program to test the queue operations
#include
#include "linkedList.h"
#include "queueLinked.h"

using namespace std;

int main()
{
linkedQueueType queue;
linkedQueueType copyQueue;

int num;

cout<<"Queue Operations"< cout<<"Enter numbers ending with -999"< cin>>num;

while(num != -999)
{
queue.addQueue(num); //add an element to the queue
cin>>num;
}

copyQueue = queue; //copy the queue into copyQueue

cout<<"Queue contains: ";
while(!copyQueue.isEmptyQueue())
{
cout< copyQueue.deleteQueue(); //remove an element from
//the queue
}

cout<
return 0;
}

Question 11

Refer to the figure above. Assume you add the numbers 23, 76, 64 in this order. The output of the program will be which of the following?

1. Queue contains: 64 76 23

2. Queue contains: 23 76 64

3. Queue contains: 23 64 76

4. Queue contains: 76 64 23

Question 12

The function addQueue does which of the following?

1. adds all the contents from one queue to another

2. appends one queue to the back of another

3. adds a new element to the front of the queue

4. adds a new element to the rear of the queue

 

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Refer to the figure above assume you add the numbers 23 76
Reference No:- TGS01247476

Now Priced at $20 (50% Discount)

Recommended (94%)

Rated (4.6/5)