Machine-translated by Google. Questions are authored in English.
Top

Discussion

A deque is :

  • A.A queue implemented with a doubly linked list
  • B.A queue implemented with both singly and doubly linked lists
  • C.Just a queue
  • D.A queue with insert and delete defined for both front and rear ends of the queue

Answer: D

A deque is a queue with insert and delete defined for both front and rear ends of the queue.

Deque stands for double-ended queue. Unlike an ordinary queue, which inserts at the rear and deletes at the front, a deque allows insertion and deletion at both ends, so it can serve as a stack or a queue.

The definition is about the operations allowed, not the implementation. A deque can be implemented with a doubly linked list or a circular array, so options A and B describe possible implementations rather than what a deque is, and 'just a queue' misses the two-ended operations.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.