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
Original Khojo Papers practice question — not from a past board paper.
Evaluating and converting arithmetic expressions between infix, prefix and postfix notation. Holding the return addresses and local variables of method calls, including recursive ones. Providing the undo facility of an editor, and checking that brackets in an expression are balanced.
No citable source has been recorded for this record. Treat it as practice material, not as fact.
Backtracking algorithms such as maze solving also use a stack.
From the same topic and chapter, at a similar level.
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
What is a stack? Name the two operations on it and state what overflow and underflow mean.
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