Discussions
jinto johnson

· started a discussion

· 1 Months ago

To insert/delete a node with a particular value in DLL (doubly linked list) entire list need to be traversed to find the location hence these operations should be O(n).

Question:

In a linked list implementation of a queue with two pointers : front and rear, the time needed to insert element in a queue of length n is      

Options:
A) 0 (1)   
B) 0 (log2 n) 
C) 0 (n)   
D)

0 (n log2 n)


E) None of these
Solution:

Ans: (a)

All Rights Reserved Top Rankers