Order the steps of a linked-list dequeue

A queue is implemented with singly linked nodes. It keeps a head reference to the oldest node and a tail reference to the newest node, and both are null when the queue is empty. Put the steps of a correct dequeue operation in the order they must run, so that the oldest value is returned and both references remain valid afterwards, even when the queue held exactly one element.

Loading ordering steps…

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

More Queues Questions: