>
Computer Science
List of top Computer Science Questions on Stack
What will be the postfix equivalent of the expression (A + B)* (C - D)?
CUET (UG) - 2026
CUET (UG)
Computer Science
Stack
In the below stack operation, what will be the output value for the variable 'result'?
result = 0
stack = [10, 20, 30]
stack.append(40)
result += stack.pop()
result += stack.pop()
CUET (UG) - 2026
CUET (UG)
Computer Science
Stack
Consider an empty stack. What will the stack look like (starting from the top) after executing the following operations in sequence?
1. push(7)
2. push(5)
3. push(9)
4. push(11)
5. pop()
6. push(22)
(A) 22
(B) 9
(C) 5
(D) 7
Choose the correct answer from the options given below:
CUET (UG) - 2026
CUET (UG)
Computer Science
Stack
Which of the following are applications of stack?
A. Print commands from multiple files from the same computer
B. Bangles worn on wrist
C. Multiple chairs in a vertical pile
D. Pile of clothes in an almirah
Choose the correct answer from the options given below:
CUET (UG) - 2026
CUET (UG)
Computer Science
Stack
In a stack of Size 'N', if there are 'M' elements inserted into the stack and then 'M/2' are popped out. What is the remaining number of elements left in the stack? Assume 'M' $<$ 'N'.
CUET (UG) - 2026
CUET (UG)
Computer Science
Stack
What will be the sequence of elements removed from the stack after performing the following operations?
Operations:
PUSH(10)
PUSH(20)
POP()
POP()
PUSH(30)
PUSH(40)
POP()
POP()
Options:
(A) 10
(B) 20
(C) 30
(D) 40
Choose the correct sequence from the options given below:
CUET (UG) - 2024
CUET (UG)
Computer Science
Stack
Match List-I with List-II:
List-I (Term)
List-II (Description)
(A) Prefix
(I) In this, the element entered first will be removed last
(B) Postfix
(II) In this, the element entered first will be removed first.
(C) Queue
(III) In this, the operator is placed before the operands.
(D) Stack
(IV) In this, the operator is placed after the operands.
CUET (UG) - 2024
CUET (UG)
Computer Science
Stack
Stack works on the principle of ________.
CUET (UG) - 2024
CUET (UG)
Computer Science
Stack