Aspire's Library

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations - NIMCET

Previous Year Question (PYQs)



If we have six stack operations; pushing and popping each of $A$, $B$ and $C$ such that push$(A)$ must occur before push$(B)$ which must occur before push$(C)$, then $A,B,C$ is a possible order for the pop operations. Which one of the following orders could not be the order the pop operations are run, if we are to satisfy the requirements described above?





Solution

Push order: $A \rightarrow B \rightarrow C$ Valid pop orders must follow stack (LIFO) constraints. BAC cannot occur under stack rules with given push order.


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

Ask Your Question or Put Your Review.

loading...