Problems on Stacks and Queues for Interviews and Self Assessments
Below are some of the problems based on stacks and queues. You will also find applications of stacks and queues in other sections such as Trees and Graphs.
Important Points to Remember
- Stack uses the LIFO (Last In First Out) ordering.
- Queue uses the FIFO (First In First Out) ordering.
Important Points to Revise
- Arrays, Linked Lists
- Implement a stack
- Implement a queue
Add a getMinimum() function to a Stack class of integers.
Assumptions and requirements:
- Stack has push() and pop() method
- push(), pop() and getMinimum() should operate in O(1)
- Assumptions and requirements:
Refer to individual problems under corresponding problem category for solutions.