Filters
Question type

Study Flashcards

When items are removed from a priority queue, items of lower priority are removed before those of higher priority.

A) True
B) False

Correct Answer

verifed

verified

Which of the following is true about a standard queue?


A) the item that has been waiting the shortest is popped next
B) the items are popped in LIFO order
C) the item that has been waiting the longest is popped next
D) removals are done from the rear of the queue

E) B) and D)
F) A) and B)

Correct Answer

verifed

verified

Which of the following is NOT true of a priority queue?


A) when items are added, they are assigned an order of rank
B) items of higher priority are removed before those of lower priority
C) items of higher priority are removed in FIFO order
D) items of equal priority are removed in FIFO order

E) B) and D)
F) None of the above

Correct Answer

verifed

verified

In a priority queue, items waiting in the queue the longest are always popped next.

A) True
B) False

Correct Answer

verifed

verified

The ready queue contains processes waiting to use the CPU.

A) True
B) False

Correct Answer

verifed

verified

In computer science, process scheduling can be handled by simple or priority queues.

A) True
B) False

Correct Answer

verifed

verified

Which of the following is NOT true of a priority queue?


A) higher-priority items are popped before those of lower priority
B) items of equal priority are popped in LIFO order
C) items of equal priority are popped according to which item arrived first
D) higher-priority items can jump ahead of lower-priority items

E) All of the above
F) B) and C)

Correct Answer

verifed

verified

In the supermarket simulation, which of the following would be a property of a Cashier object?


A) assigns customers to cashiers
B) a queue of customer objects
C) a variable to track when service is received
D) generates new customer objects

E) A) and D)
F) B) and C)

Correct Answer

verifed

verified

When using a circular array implementation for a queue, during the add operation, the front pointer moves ahead of the rear pointer.

A) True
B) False

Correct Answer

verifed

verified

False

The add operation for a queue adds a node at the head of the structure.

A) True
B) False

Correct Answer

verifed

verified

In a linked implementation of a queue, what does the add operation do?


A) adds a node to the head
B) adds a node to the tail
C) inserts a node in the middle
D) creates a new instance of the queue

E) B) and C)
F) A) and C)

Correct Answer

verifed

verified

What must occur when a wrapped item is accessed with the peek or pop method in a priority queue?


A) it must be added to the priority queue
B) it must be unwrapped
C) it must be compared to the next item
D) it must be discarded

E) B) and C)
F) A) and D)

Correct Answer

verifed

verified

An example of a computer simulation that can use queues is traffic flow on a busy highway.

A) True
B) False

Correct Answer

verifed

verified

When using a circular array implementation for a queue, when either pointer is about to run off the end of the array, that pointer is reset to -1.

A) True
B) False

Correct Answer

verifed

verified

False

Simulation programs can use a range of integer values to mimic variability in the simulation.

A) True
B) False

Correct Answer

verifed

verified

When items are added to a priority queue, they are assigned an order of rank.

A) True
B) False

Correct Answer

verifed

verified

True

In a priority queue, what does the add method do when handling a new item and the new item is greater than or equal to the item at the rear?


A) it adds the item to the front
B) it puts the item in a wrapper
C) it adds the item to the rear
D) it increases the size of the queue

E) B) and C)
F) B) and D)

Correct Answer

verifed

verified

What can you do if items in a priority queue cannot use the comparison operators?


A) user a wrapper class
B) remove them from the queue
C) remove them in FIFO order
D) put them in the back of the queue

E) B) and D)
F) All of the above

Correct Answer

verifed

verified

In the array implementation of a queue, the pop operation is most efficient if the front of the queue is fixed at index position 0.

A) True
B) False

Correct Answer

verifed

verified

A checkout line at a grocery store is an example of a queue.

A) True
B) False

Correct Answer

verifed

verified

Showing 1 - 20 of 50

Related Exams

Show Answer