retagged by
8,112 views

1 Answer

Best answer
5 votes
5 votes

Queue using singly Linked List, enqueue will take O(n) and Dequeue will take O(1) time. 

Because for enqueue operation, insert at the tail of the linked list and for dequeue remove from the beginning of the linked list (FIFO).

but if we maintain an extra pointer both will take O(1).

selected by

Related questions

2 votes
2 votes
2 answers
2
4 votes
4 votes
1 answer
3
Hemant Parihar asked Jan 20, 2018
1,539 views
In implementation of queue using stack, deletion of second element from front take Ο(1) time, when insertion take Ο(n) time.Which of the following is correct ?True / Fa...