– Rajesh implements queue as a singly-linked linked list. The queue has nelements.The time complexity to ADD a new element to the queue:
A. (1)
B. (log2 n)
C. (n)
D. (n log2 n )
Answer:A
– Rajesh implements queue as a singly-linked linked list. The queue has nelements.The time complexity to ADD a new element to the queue:
A. (1) B. (log2 n) C. (n) D. (n log2 n )
Explanation: Because it follows FIFO. NOTE – in normal case insertion andDeletion in Linked list take O(1) time.