Respuesta :
Answer:
The code prints 2 5.
Explanation:
Stack after all insertions is: 3(top),4,5(bottom)
Pop(myStack, item) it will pop 3.
4 is popped and divided by 2 and again pushed. Stack here is : 2,5
So, final popping of all remaining elements will result in output of 2 5
Explanation:
What is written by the following algorithm?
Push(myStack, 5)Push(myStack, 4)Push(myStack, 3)Pop(myStack, item)item = item * 2Pop(myStack, item)item = item / 2Push(myStack, item)WHILE (NOT IsEmtpy(myStack)) Pop(myStack, item) Write item, '