Vidyalelo
Data Structure · Q122

Introduction to Data Structures

Programming · Data Structure · question 122

Q122

Consider you have a stack whose elements in it are as follows. 5 4 3 2 << top Where the top element is 2. You need to get the following stack 6 5 4 3 2 << top The operations that needed to be performed are (You can perform only push and pop):

A.
Push(pop()), push(6), push(pop())
Answer
B.
Push(pop()), push(6)
C.
Push(pop()), push(pop()), push(6)
D.
Push(6)

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board