Exam 8: Queues

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Give two examples of run-time errors or exceptions that may occur when we enqueue or dequeue.

Free
(Essay)
4.9/5
(41)
Correct Answer:
Verified

It's an error to attempt to dequeue from an empty queue.Also,if the queue is represented as an array and we try to enqueue,we may run up against the maximum size of the queue.

The ______ operation retrieves the item that was added earliest to a queue,but does not remove that item.

Free
(Multiple Choice)
4.8/5
(40)
Correct Answer:
Verified

D

Operations on a queue can be carried out at ______.

Free
(Multiple Choice)
4.8/5
(39)
Correct Answer:
Verified

C

In an event-driven simulation of a bank,which of the following is an internal event?

(Multiple Choice)
4.9/5
(34)

To initialize a queue that is represented by a circular array,back is set to ______.

(Multiple Choice)
4.8/5
(38)

In an event-driven simulation of a bank,the departure times of customers are determined by the simulation.

(True/False)
4.7/5
(38)

A reference-based implementation of a queue that uses a circular linked list would need at least ______ external references.

(Multiple Choice)
4.9/5
(30)

A queue can be used to preserve the order of occurrences.

(True/False)
4.7/5
(44)

Which of the following code fragments is used to delete the item at the front of a queue represented by a circular array?

(Multiple Choice)
4.8/5
(47)

The Java ______ operator is used to obtain the wraparound effect of a circular array-based queue.

(Multiple Choice)
4.8/5
(32)

Define the problem of rightward drift in an array-based implementation of a queue.

(Essay)
4.7/5
(36)

If a queue is implemented as the ADT list,which of the following queue operations can be implemented as list.get(1)?

(Multiple Choice)
4.8/5
(36)

Which of the following methods of QueueInterface does NOT throw a QueueException?

(Multiple Choice)
5.0/5
(48)

What is the action performed by the peek operation?

(Essay)
4.8/5
(50)

In an event-driven simulation of a bank,which of the following equations can be used to determine the time of a customer's departure?

(Multiple Choice)
4.9/5
(39)

Which of the following is an operation of the ADT stack?

(Multiple Choice)
4.9/5
(44)

What is the advantage an implementation of a queue that uses the ADT list over an implementation that uses a linked list?

(Essay)
4.8/5
(35)

To initialize a queue that is represented by a circular array,front is set to ______.

(Multiple Choice)
4.9/5
(28)

Which of the following ADTs is like a line of people?

(Multiple Choice)
4.8/5
(40)

Rightward drift is a problem that is encountered in a reference-based implementation of a queue.

(True/False)
4.8/5
(39)
Showing 1 - 20 of 60
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)