Q1:

2026: 31 May Shift 1

Stack

Medium

Computer Science

The following operations are performed on an empty stack:

push(10) push(20) push(30) pop() push(46) pop() pop() push (34) push(12) pop() push(16) push(4)

Which of the following elements will be present on the stack?

A. 16

B. 10

C. 4

D. 34

Answer options
Option 3
Correct Answer
Explanation for 2026: 31 May Shift 1 CSE question 1

Q2:

2026: 31 May Shift 1

Stack

Medium

Computer Science

Consider the given stack with 6 elements at the beginning as shown below:

2573113

If the following operations are performed in order

push(10), pop(), push(15), pop(), push(35), pop(), pop() , pop(), pop()

Specify the order of elements in which they are popped in last four pop() operations.

A. 3

B. 1

C. 13

D. 35

Answer options
Option 1
Correct Answer
Explanation for 2026: 31 May Shift 1 CSE question 2

Q3:

2026: 31 May Shift 1

Stack

Medium

Computer Science

Match the LIST-I with LIST-II

LIST-ILIST-II
A.Conversion of an Infix notation to its equivalent Prefix/Postfix notationI.Only operands are PUSHed onto it.
B.When evaluating any Postfix expression using StackII.(x + y)/(z * 5)
C.Example of Infix notationIII.Only operators are PUSHed onto the Stack.
D.Example of Prefix (Polish) notationIV./+xy*z5
Answer options
Option 4
Correct Answer
Explanation for 2026: 31 May Shift 1 CSE question 3

Q6:

2026: 29 May Shift 2

Stack

Easy

Computer Science

Trying to pop an element from an empty stack results into a special condition called __________.

Answer options
Option 2
Correct Answer
Explanation for 2026: 29 May Shift 2 CSE question 6

Q7:

2026: 29 May Shift 2

Stack

Medium

Computer Science

Consider the given function named 'display' to show the contents of the stack:

def display(glassStack)

Arrange the following code statements in correct sequence to complete the above function.

A. print("Current elements in the stack are: ")

B. print(glassStack[i])

C. for i in range(x-1,-1,-1):

D. x=len(glassStack)

Answer options
Option 1
Correct Answer
Explanation for 2026: 29 May Shift 2 CSE question 7

Q8:

2026: 29 May Shift 2

Stack

Easy

Computer Science

Consider a stack with a maximum capacity of 5. The following operations take place on that stack:

PUSH(5), PUSH(6), POP, PUSH(7), POP, PUSH(8)

What are the contents of the stack after these operations?

Answer options
Option 2
Correct Answer
Explanation for 2026: 29 May Shift 2 CSE question 8

Q9:

2026: 29 May Shift 1

Stack

Easy

Computer Science

Which of the following operations performed on the stack are TRUE?

(A) PUSH adds a new element at the TOP of the stack.

(B) POP operation is used to remove the top most element of the stack.

(C) Trying to add an element to a full stack results in an exception called ‘underflow’.

(D) Trying to delete an element from an empty stack results in an exception called ‘underflow’.

Answer options
Option 1
Correct Answer
Explanation for 2026: 29 May Shift 1 CSE question 9

Q10:

2026: 29 May Shift 1

Stack

Easy

Computer Science

Identify the correct code for the following:

A function named 'op' is used to delete the topmost element from the stack. It takes one parameter - the name of the stack (gStack) from which element is to be deleted and returns the value of the deleted element. The function first checks whether the stack is empty or not. If it is not empty, it removes the topmost element from it.

Answer options

Q11:

2026: 29 May Shift 1

Stack

Easy

Computer Science

Find the output of the following code using Stack:

result=0

numberList=[5,15,25]

numberList.append(35)

result=result+numberList.pop()

result=result+numberList.pop()

print(“Result=”,result)

Answer options

Q12:

2026: 29 May Shift 1

Stack

Easy

Computer Science

In Reverse Polish expression -

Answer options

Q13:

2026: 26 May Shift 1

Stack

Easy

Computer Science

Stack is commonly used data structure to convert infix expression to ____ and ______.

(A) PreStack

(B) Prefix

(C) Postfix

(D) PostStack

Answer options

Q15:

2026: 26 May Shift 1

Stack

Easy

Computer Science

Stack works on the principle of _____.

Answer options

Q16:

2026: 26 May Shift 1

Stack

Easy

Computer Science

Convert the following Infix notation to POSTFIX

(A - B) / (C + D)

Answer options

Q17:

2026: 24 May Shift 1

Stack

Medium

Computer Science

What will be the postfix equivalent of the expression (A + B)* (C - D)?

Answer options

Q18:

2026: 24 May Shift 1

Stack

Easy

Computer Science

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()

Answer options

Q19:

2026: 24 May Shift 1

Stack

Easy

Computer Science

Stack follows the ______________ principle.

Answer options

Q20:

2026: 24 May Shift 1

Stack

Easy

Computer Science

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

Answer options

Q21:

2026: 23 May Shift 2

Stack

Easy

Computer Science

Find the output of the following code:-

result = 0
numList = [10,20,30]
numList.append(40)
result = result+numList.pop()
result = result+numList.pop()
print(result)
Answer options

Q22:

2026: 23 May Shift 2

Stack

Easy

Computer Science

Which of the following are applications of stack?

A. Pile of clothes in an almirah

B. Multiple chairs in a vertical pile

C. Bangles worn on wrist

D. Pile of boxes of eatables in pantry

Answer options

Q23:

2026: 23 May Shift 2

Stack

Easy

Computer Science

The built-in methods in Python for insertion and removal of elements in list for implementation of the stack are _____ and ______.

Answer options

Q24:

2026: 23 May Shift 2

Stack

Medium

Computer Science

What is the postfix expression of the given infix expression?

(A + B) * (C - D)

Answer options

Q25:

2026: 23 May Shift 1

Stack

Easy

Computer Science

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'.

Answer options

Q28:

2026: 23 May Shift 1

Stack

Medium

Computer Science

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

Answer options

Q29:

2026: 21 May Shift 1

Stack

Medium

Computer Science

Suppose there are 3 elements 4, 2 and 7 to be input in the same order in the stack. In what sequence should the operation follow, so the final content of the stack from top to bottom is [7,4]?

(A) PUSH[4]

(B) POP

(C) PUSH[2]

(D) PUSH[7]

Answer options