A queue is implemented using a non-circular singly linked list. The queue has…
GATE · 2018 · CS · Computer Science & IT
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 denote the number of nodes in the queue. Let be implemented by inserting a new node at the head, and be implemented by deletion of a node from the tail.

Which one of the following is the time complexity of the most time-efficient implementation of and , respectively, for this data structure?
- A.
- B.
- C.
- D.
Attempted by 807 students.
Sign up free to check your answer
Sign up freeLoading lesson…