Exercise 4.4(10 points)?Use letter I and O to represent PUSH and POP operationrespectively. The initial state and end state of stack should bothbe empty, a sequence of PUSH and POP operation is represented bythe sequence composed of I and O only. Such a sequence is legalonly when it is operable, otherwise it is illegal. Write analgorithm to judge whether the following sequences are legal ornot.S1?I O O I I O I O OS2?I O O I O I I OS3?I I I O I O I OS4?I I I O O I O O
Expert Answer
An answer will
PayPal Gateway not configured
PayPal Gateway not configured