A Place for Latest Exam wise Questions, Videos, Previous Year Papers, Study Stuff for MCA Examinations - NIMCET
Previous Year Question (PYQs)
3
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.