Aspire Faculty ID #17024 · Topic: AMU MCA 2022 · Just now
AMU MCA 2022

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.

Previous 10 Questions — AMU MCA 2022

Nearest first

Next 10 Questions — AMU MCA 2022

Ascending by ID
Ask Your Question or Put Your Review.

loading...