What does LIFO, the rule a stack follows, stand for?
AnswerLast In, First Out
In a stack the most recently added item is the first one removed, like a pile of plates.
Coding · Facts & stats
7 fact-checked facts about stacks in computing, each with the reason behind it. 5 more are in today's round and join this page after it closes.
AnswerLast In, First Out
In a stack the most recently added item is the first one removed, like a pile of plates.
AnswerFirst In, First Out
A queue serves items in arrival order (FIFO), like people waiting in line.
AnswerRecursion that never reaches a stopping case
Each function call adds a frame to the call stack; endless recursion keeps adding frames until space runs out.
AnswerChecking whether brackets are balanced
Push each opening bracket and pop when a closing one appears; a mismatch or leftover means unbalanced.
AnswerStack underflow
Underflow means removing from an empty stack; overflow means adding beyond its capacity.
AnswerA stack
Numbers are pushed; each operator pops its operands, computes, and pushes the result back.
AnswerO(1), constant time
Push and pop only touch the top of the stack, so they take constant time regardless of size.