Suppose you are implementing a Queue of size N using a non-circular linked list having a front and a rear pointer as shown in the figure. The…
Suppose you are implementing a Queue of size N using a non-circular linked list having a front and a rear pointer as shown in the figure. The enqueue operation inserts a new node at the front and the dequeue operation deletes a node from the rear. Which one of the following is the time complexity of the most efficient implementation of the enqueue and dequeue operations, respectively on this data structure?
From the Combined Bank Assistant Engineer (IT) 2020 – Preliminary exam, question 7 of 37.