Data Structure Past Paper 2023
Data Structure Past Paper 2023
Steps:
1. Enqueue Operation (Insert element):
- Push the element onto Stack1.
Recursive Version:
Q4. Differences
i. Stack vs Queue:
Stack Queue
Follows LIFO (Last In First Out) Follows FIFO (First In First Out)
Only one end is used for insertion and Insertion at rear and deletion at front
deletion
Tree Graph
Linear Nonlinear
stack.pop();
stack.display();