A queue is implemented using a non - circular singly linked list. The queue has a
Fantastic news! We've Found the answer you've been seeking!
Question:
A queue is implemented using a non−circular singly linked list. The queue has a head pointer and a tail pointer, as shown in the figure. Let n denote the number of nodes in the queue. Let 'enqueue' be implemented by inserting a new node at the head, and 'dequeue' be implemented by deletion of a node from the tail.circular−linked−lis
Which one of the following is the time complexity of the most time−efficient implementation of 'enqueue' and 'dequeue, respectively, for this data structure?
Your answer:
Theta (n), Theta (n)
Theta (n), Theta (1)
Theta (1), Theta (n)
Theta (1), Theta (1)
Related Book For
Practical Introduction To Data Structures And Algorithm Analysis Java Edition
ISBN: 9780136609117
1st Edition
Authors: Clifford A. Shaffer
Posted Date: