Linear Data Structures questions

Q3

GATE CS 2018 CSLinear Data StructuresMCQ1 mark−1/3 if wrong
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 nn 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.

Which one of the following is the time complexity of the most time-efficient implementation of enqueue and dequeue, respectively, for this data structure?
Question figure
Show answer without attempting

Answer: B

0/10 correct0 marks

Related topics in Programming and Data Structures