Answer:
a) The composition of the stack is :- 80,50,20,10.
Where 80 is the top and 10 is the last element.
b) The sequence of the popped items 40,30,70,60,90.
Explanation:
Stack is LIFO type data structure means Last in First Out.The element inserted last will be out of the stack first.The removal and addition is only at the one end that is top.
First 10,20,30,40 will be inserted in the stack. 40 is a the top.Now two pop operations occurs. 40 and 30 will be removed from the stack.
Now 50,60,70 will be inserted in the stack then again two pop operations so 70 and 60 will be removed from the stack.
Now the stack contains 50,20,10.Top = 50.
80 and 90 are added to the stack and 1 pop operation that is 90 will be removed.
Stack is 80,50,20,10 . Top = 80.
Sequence of integers popped=40,30,70,60,90.