What is the output of the following stack algorithm? Push(myStack, 2) Push(myStack, 7) Push(myStack, 8) Push(myStack, 5)
Fantastic news! We've Found the answer you've been seeking!
Question:
- What is the output of the following stack algorithm?
Push(myStack, 2)
Push(myStack, 7)
Push(myStack, 8)
Push(myStack, 5)
Push(myStack, 9)
Push(myStack, 1)
Pop(myStack, item)
Write item + ", "
Pop(myStack, item)
Pop(myStack, item)
Write item + ", "
Push(myStack, item)
Push(myStack, item)
WHILE(NOT IsEmtpy(myStack))
Pop(myStack, item)
Write item + ", "
Related Book For
Posted Date: