Question: Consider an empty stack of integers. Let the numbers 1, 2, 3, 4, 5 and 6 be pushed onto this stack only in the order
Consider an empty stack of integers. Let the numbers 1, 2, 3, 4, 5 and 6 be pushed onto this stack only in the order they appeared from left to right. Let S indicate a push and X indicate a pop operation. Can they be permuted into order 325641 (output) and order 154623? (if a permutation is possible, give the order string of operations).
Step by Step Solution
3.49 Rating (146 Votes )
There are 3 Steps involved in it
Lets examine each number sequence one at a time 1 Sequence 325641 For the stack to be in this sequen... View full answer
Get step-by-step solutions from verified subject matter experts
