Name three applications of a stack.
Stacks
Original Khojo Papers practice question — not from a past board paper.
A stack is a linear data structure in which insertion and deletion take place at one end only, so the last element added is the first removed. The operations are push, which adds an element, and pop, which removes one. Overflow is an attempt to push onto a full stack and underflow an attempt to pop from an empty one.
No citable source has been recorded for this record. Treat it as practice material, not as fact.
The undo facility of an editor and the call stack of a program are both stacks.
From the same topic and chapter, at a similar level.
Name three applications of a stack.
Stacks
A stack of capacity 5 is empty. After push(1), push(2), push(3), pop(), push(4), pop(), pop(), what is left on the stack?
Stacks
Write the algorithm for the push operation on a stack implemented in an array of capacity n.
Stacks
Write a recursive Java method to compute the factorial of a non-negative integer n.
Recursion
State and verify the absorption law X + X·Y = X using a truth table.
Boolean Algebra
Convert the Boolean expression F(A, B, C) = Σ(1, 3, 5) into its canonical sum of products form.
Boolean Algebra