The initial state of a stack S and a queue Q is empty. The elements A, B, C, D, E, and F pass through the stack S in turn

The initial state of a stack S and a queue Q is empty. The elements A, B, C, D, E, and F pass through the stack S in turn, and an element enters the queue Q after being popped out.

If the dequeued order of the six elements is B, D, C, F, E, A, then what’s the minimum capacity of the stack S

Leave a Reply

Your email address will not be published.