Some sequences of I’s and O’s specify meaningless operations, sincethere may be no numbers available in the
stack; for example, the sequenceOIIOOIIO cannot be carried out, since we assume that the stack is initiallyempty. Let us call a sequence of I’s and O’s admissible if it contains n I’sand n O’s, and the operations it specified can be performed. Formulate arule by which it is easy to distinguish between admissible and inadmissiblesequences; show furthermore that no two different admissible sequences givethe same output permutation.
To check whether it is a admissible or not, we pop every element and check whether its I or O and take a count, if that... View the full answer