Vidyalelo
Data Structure · Q152

Stacks in Data Structures

Programming · Data Structure · question 152

Q152

What are the set of functions that are to be executed to get the following output? cat

A.
push(c, s); push(a, s); push(t, s);
pop(s); pop(s); pop(s);
B.
push(c,s); pop(s); push(a,s); pop(s);push(t,s);pop(s);
Answer
C.
pop(c ); pop(a); pop(t);
D.
push(c,s); push(a,s); pop(t);

Answer: Option B

Solution

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