LIFO
Everything on SkillVeris tagged LIFO — collected across the glossary, study notes, blog, and cheat sheets.
4 resources across 1 library
Interview Questions(4)
Difference Between Stack and Queue
A stack is a LIFO (Last In, First Out) structure where the last element added is the first removed, while a queue is a FIFO (First In, First Out) structure whe…
How Do You Solve the Valid Parentheses Problem?
The valid parentheses problem is solved with a stack: push every opening bracket you encounter, and on every closing bracket, check that the stack's top is the…
How Would You Implement a Stack Using Queues?
A stack (LIFO) can be built from one or two FIFO queues by rotating the queue after every push so the newest element sits at the front, which makes push O(n) a…
How Would You Implement a Queue Using Stacks?
A queue (FIFO) can be built from two stacks: an 'in' stack absorbs every enqueue in O(1), and an 'out' stack is refilled by popping everything off 'in' and pus…