I have a Stack1 which has the entries a,b,c ( with a on the Top) and Stack2 which is empty.The condition is.
An entry pooped out of the stack1 can be printed immediatly or pushed to stack2. An Entry popped out of the stack2 can only be printed.
In this Arrangement, which of the permutation of a,b,c is not possible.
I tried diagrammatically by popping out the initial stack and found the first arrangement as c,a,b...Then i mind a formula taught in Permutation's course as (n-1)! possibilites so came up with answer of 5.
so, which arrangement will be not possible.??