A help desk places incoming requests in an ordinary queue. It serves one request at a time, without assigning priorities or rearranging requests. Which rule determines the next request served?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A queue's operations, positions and error conditions each have a precise meaning. Match each term on the left to the description that defines it for an ordinary first-in, first-out queue.

Match each term
A.

Return the oldest element without removing it from the structure

B.

Add a new element at the back of the line of waiting elements

C.

The end of the queue where the next arriving element is placed

D.

The error raised by trying to remove an element when none are stored

E.

Remove and return the element that has been waiting the longest

F.

The error raised by trying to add an element when a fixed-capacity structure has every slot occupied

Underflow

Rear

Overflow

Enqueue

Dequeue

Peek

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A print server's queue initially contains the requests shown below. Here, enqueue adds a request at the rear, and dequeue removes and returns the request at the front. The operation peek() returns the front request without removing it.


The initial queue contains requests C12, C17, and C23 from front to rear.


Perform the table's operations from top to bottom. Enter each returned request identifier and the queue's size immediately after that operation. Sizes are exact integers in requests. The enqueue operations do not return a request, so those cells are already marked not applicable.

OperationReturned requestSize after operation (requests)
dequeue()
enqueue(C29)Not applicable
peek()
dequeue()
enqueue(C34)Not applicable
dequeue()

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Extra Practice