Stack Data Structure: 20 flashcards
All 20 flashcards from this kit, free and with no sign-up.
1. What does LIFO stand for in a stack?
Show the answer
Last In, First Out — the most recently pushed element is the first to be popped.
2. At which end of a stack do insertions and deletions happen?
Show the answer
Only at the top.
3. What is the push operation?
Show the answer
Inserting a new element at the top of the stack.
4. What is the pop operation?
Show the answer
Removing and returning the top element of the stack.
5. What does peek (or top) do?
Show the answer
Returns the top element without removing it.
6. What is the time complexity of push, pop, and peek?
Show the answer
$O(1)$ constant time.
7. What is an abstract data type (ADT)?
Show the answer
A specification of behaviour (operations) without defining the underlying storage.
8. How does an array-based stack track the top?
Show the answer
With an integer top index pointing to the last filled position.
9. How does a linked-list stack represent the top?
Show the answer
The head of the linked list is the top of the stack.
10. What is stack underflow?
Show the answer
Calling pop or peek on an empty stack.
11. What is stack overflow?
Show the answer
Pushing onto a fixed-capacity stack that is already full.
12. What is the call stack?
Show the answer
A runtime stack that stores function frames (parameters, locals, return address) to manage function calls and recursion.
13. What is stored in a stack frame?
Show the answer
Parameters, local variables, and the return address of a function call.
14. How is undo implemented with a stack?
Show the answer
Each action is pushed onto an undo stack; undo pops the most recent action and reverses it.
15. How does browser back navigation use a stack?
Show the answer
Visited pages are pushed; pressing back pops the current page to reveal the previous one.
16. Why do balanced-bracket checks use a stack?
Show the answer
Opening brackets are pushed and popped when a matching closing bracket appears; a mismatch signals an error.
17. Which search algorithm uses a stack?
Show the answer
Depth-first search (DFS).
18. Can a stack give random access to middle elements?
Show the answer
No — only the top element is directly reachable.
19. What is the key structural difference between a stack and a queue?
Show the answer
A stack is LIFO (one end), a queue is FIFO (insert at rear, remove at front).
20. What are two common implementations of a stack?
Show the answer
Array-based (fixed or dynamic) and linked-list based.
Your notes can be a kit like these
Every kit here was made from real study material. Point Veda at a chapter, a PDF, a photo or a link and get notes, flashcards, practice MCQs, games and a scored test — free to start, in more than 40 languages.
- Chapter notes
- Flashcards
- Practice MCQs
- Scored tests
- Paper Solver
Get Veda free See what students get
Free to start · Android app and web · More than 40 languages