If a stack or queue is implemented using a single linked list, then which of the below options are true?
i. Singly linked list is better for stack implementation, it is faster.
ii. Singly linked list is better for queue implementation, it is faster.
iii. Don't use singly linked list for either stack or queue, its very slow.
i & ii
Compared to queue, implementing a stack using a singly linked list is faster, because in stack we add or delete at only one end which can be done easily. but in queue insertion happens at rear(end) and deletion happens at front, which is tough(Takes more time complexity) to implement a queue with singly linked list.
Back To Top