Difference between Stacks and Queues


S. No. Stack Queue
1. A stack is LIFO type of list. A queue is FIFO type of list.
2. Only top element of stack is visible. Only front and rear elements are visible.
3. In a stack insertion and deletions are possible only at one end. In a queue insertion is done at one end and deletion is done at other end.
4. Only one item can be added at a time. Only one item can be added at a time.
Previous Post Next Post