25 votes 25 votes The following sequence of operations is performed on a stack: $PUSH (10), PUSH (20), POP, PUSH (10), PUSH (20), POP, POP, POP, PUSH (20), POP$ The sequence of values popped out is $20,10,20,10,20$ $20,20,10,10,20$ $10,20,20,10,20$ $20,20,10,20,10$ DS gate1991 data-structures stack easy + – Kathleen asked Sep 12, 2014 • retagged Dec 14, 2023 by Hira Thakur Kathleen 4.4k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 33 votes 33 votes Let us try something different when you read the word pop then delete the last pushed element and print it. Now, delete the push word which we have already executed. Now, go on from left to right and do the same. So, output will be $20, 20, 10, 10, 20$. Correct Answer: B. Bhagirathi answered Oct 10, 2014 • edited Apr 17, 2021 by Lakshman Bhaiya Bhagirathi comment Share Follow See all 0 reply Please log in or register to add a comment.
16 votes 16 votes Nothing to explain. It will be B. Gate Keeda answered Oct 10, 2014 Gate Keeda comment Share Follow See all 0 reply Please log in or register to add a comment.
4 votes 4 votes Just simple push pop operation option B Rishi yadav answered Oct 3, 2017 Rishi yadav comment Share Follow See all 0 reply Please log in or register to add a comment.
3 votes 3 votes 20 20 10 10 20 pankaj_vir answered Mar 23, 2018 • edited Mar 23, 2018 by pankaj_vir pankaj_vir comment Share Follow See all 0 reply Please log in or register to add a comment.