Uml diagram adds an element to the front of the queue?

Assignment Help C/C++ Programming
Reference no: EM13938161

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 <iostream>
#include "linkedList.h"
#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 the queue into copyQueue

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

cout<<endl;

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<<copyQueue.front();

2. cout<<copyQueue.back();

3. cout<<copyQueue.remove();

4. cout<<copyQueue.addQueue();

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 <iostream>
#include "linkedList.h"
#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 the queue into copyQueue

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

cout<<endl;

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

 

Reference no: EM13938161

Questions Cloud

Implementing a health information technology strategic plan : Discuss how you would go about implementing a health information technology (HIT) strategic plan for data security, privacy, and quality management for your organization
Monitoring systems section of lecture : In the Monitoring Systems section of this lecture (attached), we mentioned that: It should be noted that these example protocols are not really related to computer systems.
Differentiate between data-information and knowledge : A key understanding within knowledge management is to be able to define and differentiate between data, information and knowledge.
Summary of physical tamper-resistant : Summary of physical tamper-resistant devices how to approach this homework question: a. First, make a list of all of the different types of physical tamper-resistant devices and their characteristics.
Uml diagram adds an element to the front of the queue? : 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?
Calculate net profit margin and accounts receivable turnover : The following information was taken from Nash, Inc.'s trial balances as of December 31, 2008,  and  December  31, 2009. Calculate the net profit margin and accounts receivable turnover for 2009.
Network infrastructure layer and in user clients or browsers : Web phishing, pharming and vishing are popular web based scams. Discuss currently used tools and recommended measures to defeat this kind of attacks efficiently? Specifically focus on solutions that can be implemented at the network infrastructure..
Determine the best way to export her new grass seed : How should Martha proceed to determine the best way to export her new grass seed?
Key understanding within knowledge management : A key understanding within knowledge management is to be able to define and differentiate between data, information and knowledge.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd