Q. Compare and contrast queue with stack.


Answer :-

Similarities:

1. Both Queues and Stacks are special cases of linear lists.
2. Both can be implemented as arrays or linked lists.

Differences:

1. A Stack is a LIFO list, a Queue is a FIFO list.
2. There are no variations of Stack; a Queue, however, may be circular or dequeue.

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post