Deck 8: Queues
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/48
Play
Full screen (f)
Deck 8: Queues
1
The notion of a queue in computer science is the same as the notion of the queues to which you are accustomed in everyday life.
True
2
The general rule to process elements in a queue is that the customer at the end of the queue is served next and that when a new customer arrives, he or she stands at the front of the queue.
False
3
The front of the queue is accessed whenever a new element is added to the queue.
False
4
The front of the queue is accessed whenever an element is deleted from the queue.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
5
The queue operation end returns the last element of the queue.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
6
The queue operation isFullQueue determines whether the queue is full.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
7
Prior to the deleteQueue operation, the queue must exist and must not be full.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
8
Prior to the addQueue operation, the queue must exist and must not be empty.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
9
A queue cannot be stored in an array.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
10
Because the size of the array to store queue elements is fixed, only a finite number of queue elements can be stored in the array.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
11
The queue is empty if queueFront is NULL.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
12
If the queue is nonempty, the operation top returns the first element of the queue.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
13
The linked implementation of a queue is similar to the implementation of a linked list created in a backward manner.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
14
Because a queue is an important data structure, the Standard Template Library (STL) provides a class to implement queues in a program.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
15
The use of a queue structure ensures that the items are processed in the order they are received.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
16
Computer simulations are particularly useful for simple systems where it is easy to construct a mathematical model.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
17
In mathematical simulations, the steps of a program are used to model the behavior of a real system.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
18
The function members of the class describe the properties of the objects, and the class variables describe the actions on that data.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
19
The main goal of a computer simulation is to either generate results showing the performance of an existing system or predict the performance of a proposed system.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
20
A queuing system only consists of queues of objects waiting to be served.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
21
A printer acts as the server when a queue of documents is waiting to be printed.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
22
Every customer has a customer number, arrival time, waiting time, transaction time, and departure time.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
23
At any given time, a server is either free or busy.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
24
In this chapter, the class that implements a list of servers has three member variables.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
25
Using static arrays, depending on the number of servers specified by the user, a list of servers is created during program execution.
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
26
Whenever a system is modeled on the First In First Out principle, ____ are used.
A) stacks
B) trees
C) arrays
D) queues
A) stacks
B) trees
C) arrays
D) queues
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
27
A ____ is a set of elements of the same type in which the elements are added at one end.
A) hash table
B) tree
C) queue
D) network
A) hash table
B) tree
C) queue
D) network
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
28
Elements are added at one end of the queue, called the ____ or rear.
A) back
B) head
C) top
D) middle
A) back
B) head
C) top
D) middle
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
29
Elements are deleted from the end of the queue called the ____.
A) rear
B) front
C) tail
D) middle
A) rear
B) front
C) tail
D) middle
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
30
The queue operation ____ returns the first element of the queue.
A) tail
B) insert
C) front
D) delete
A) tail
B) insert
C) front
D) delete
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
31
The queue operation ____ determines whether the queue is full.
A) isFullQueue
B) isNullQueue
C) queueFront
D) deleteQueue
A) isFullQueue
B) isNullQueue
C) queueFront
D) deleteQueue
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
32
The queue operation ____ removes the front element from the queue.
A) isFullQueue
B) queueFront
C) isNullQueue
D) deleteQueue
A) isFullQueue
B) queueFront
C) isNullQueue
D) deleteQueue
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
33
To implement the deleteQueue operation, we access the index ____.
A) queueBack
B) queueFront
C) queueTail
D) queueCurrent
A) queueBack
B) queueFront
C) queueTail
D) queueCurrent
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
34
The operation ____ initializes the queue to an empty state.
A) initializeQueue
B) wipeQueue
C) newQueue
D) cleanQueue
A) initializeQueue
B) wipeQueue
C) newQueue
D) cleanQueue
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
35
If the queue is nonempty, the operation ____ returns the last element of the queue and so the element of the queue indicated by the pointer queueRear is returned.
A) front
B) middle
C) near
D) back
A) front
B) middle
C) near
D) back
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
36
When the destructor ____ the queue, it deallocates the memory occupied by the elements of the queue.
A) allocates
B) instantiates
C) destroys
D) rebuilds
A) allocates
B) instantiates
C) destroys
D) rebuilds
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
37
When the queue object goes out of scope, the ____ destroys the queue.
A) destructor
B) constructor
C) garbage collector
D) house keeper
A) destructor
B) constructor
C) garbage collector
D) house keeper
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
38
The ____ operation on a queue inserts a copy of item into the queue.
A) front
B) back
C) pop
D) push(item)
A) front
B) back
C) pop
D) push(item)
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
39
The ____ operation on a queue returns the last element in the queue, but does not remove the element from the queue.
A) front
B) back
C) pop
D) push(item)
A) front
B) back
C) pop
D) push(item)
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
40
The ____ operation on a queue removes the next element in the queue.
A) front
B) back
C) pop
D) push(item)
A) front
B) back
C) pop
D) push(item)
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
41
In a ____, customers or jobs with higher priority are pushed to the front of the queue.
A) double queue
B) false queue
C) free queue
D) priority queue
A) double queue
B) false queue
C) free queue
D) priority queue
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
42
The STL provides the class template ____, where the data type of the queue elements is specified by elemType.
A) priority_queue<elemType>
B) prio_queue<elemType>
C) queue<elemType>
D) queue<elemType>.priority
A) priority_queue<elemType>
B) prio_queue<elemType>
C) queue<elemType>
D) queue<elemType>.priority
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
43
In computer simulation, the objects being studied are usually represented as ____.
A) data structures
B) processes
C) programs
D) data
A) data structures
B) processes
C) programs
D) data
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
44
____ are systems in which queues of objects are waiting to be served by various servers.
A) Queuing networks
B) Queuing systems
C) Holding systems
D) Standby systems
A) Queuing networks
B) Queuing systems
C) Holding systems
D) Standby systems
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
45
The time it takes to serve a customer is the ____.
A) transaction time
B) flight time
C) request time
D) service time
A) transaction time
B) flight time
C) request time
D) service time
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
46
In a ____, the clock is implemented as a counter and the passage of, say, 1 minute can be implemented by incrementing the counter by 1.
A) transaction-driven simulation
B) user-driven simulation
C) time-driven simulation
D) data-driven simulation
A) transaction-driven simulation
B) user-driven simulation
C) time-driven simulation
D) data-driven simulation
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
47
The two objects needed to implement a time-driven computer simulation of a queuing system are ____.
A) the clock and the server
B) the clock and the customer
C) the clock and the queue
D) the customer and the server
A) the clock and the server
B) the clock and the customer
C) the clock and the queue
D) the customer and the server
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck
48
A ____ is a set of servers.
A) server list
B) customer list
C) data list
D) queue list
A) server list
B) customer list
C) data list
D) queue list
Unlock Deck
Unlock for access to all 48 flashcards in this deck.
Unlock Deck
k this deck