Question
1.
2.
3.
4.
Answer (Detailed Solution Below)
Option 3 : 5
Advertisement
Detailed Solution
सही उत्तर 5 है।
Key Points
Helpful?
Question:
The values 5, 3, 8 are pushed onto an empty stack in that order. Then one pop, one push of 2, two pops, and finally one pop whose value is printed. What is printed? / एक खाली स्टैक में क्रमशः 5, 3, 8 पुश किए जाते हैं। फिर एक पॉप, 2 का एक पुश, दो पॉप, और अंत में एक पॉप जिसका मान प्रिंट किया जाता है। क्या प्रिंट होगा?
1.
3
2.
8
3.
5
4.
2
Correct Answer: 5
After push 5,3,8 the stack is [5,3,8] (top 8); pop removes 8; push 2 gives [5,3,2]; two pops remove 2 and 3; the final pop removes and prints 5. / 5,3,8 पुश के बाद स्टैक [5,3,8] (शीर्ष 8); पॉप 8 हटाता है; 2 पुश से [5,3,2]; दो पॉप 2 और 3 हटाते हैं; अंतिम पॉप 5 हटाकर प्रिंट करता है।
Downloaded from PrepSnap (prepsnap.in)