Stack — NCERT Solutions
CBSE · Class 12 · Computer Science
NCERT Solutions for Stack, CBSE Class 12 Computer Science: 11 textbook questions solved step by step. Covers Exercise.
Interactive on Super Tutor
Studying Stack? Get the full interactive chapter.
Quizzes, flashcards, AI doubt-solver and a step-by-step study plan — built for NCERT solutions and more.
Free trial, no card needed.

Learn better with visuals Super Tutor pairs illustrations like this with notes and quizzes for Stack.
Get startedThe first 6 solutions are open to read. The other 5 are free with a Super Tutor account. Unlock all 11 free in Super Tutor
Exercise
1aStack is a linear data structure- State TRUE or FALSE for the following cases:
Show solution
- State TRUE or FALSE for the following cases:
A stack is a linear data structure because its elements are arranged in a sequence.
Not sure why a step works? check your working in Super Tutor
1bStack does not follow LIFO rule- State TRUE or FALSE for the following cases:
Show solution
- State TRUE or FALSE for the following cases:
A stack follows the LIFO rule, so the statement is incorrect.
Not sure why a step works? check your working in Super Tutor
1cPUSH operation may result into underflow condition- State TRUE or FALSE for the following cases:
Show solution
- State TRUE or FALSE for the following cases:
Underflow happens when we try to POP from an empty stack. PUSH can cause overflow, not underflow.
Not sure why a step works? check your working in Super Tutor
1dIn POSTFIX notation for expression, operators are placed after operands- State TRUE or FALSE for the following cases:
Show solution
- State TRUE or FALSE for the following cases:
In postfix notation, the operator is written after the operands.
Not sure why a step works? check your working in Super Tutor
2aFind the output of the following code:result=0
numberList=[10,20,30]
numberList.append(40)
result=result+numberList.pop()
result=result+numberList.pop()
print("Result=",result)
Show solution
result=0
numberList=[10,20,30]
numberList.append(40)
result=result+numberList.pop()
result=result+numberList.pop()
print("Result=",result)
Start with result = 0 and numberList = [10, 20, 30].
- After
append(40):numberList = [10, 20, 30, 40] numberList.pop()removes 40, soresult = 0 + 40 = 40- Next
numberList.pop()removes 30, soresult = 40 + 30 = 70
So the output is Result= 70.
Not sure why a step works? check your working in Super Tutor
2bFind the output of the following code:answer=[]; output=""
answer.append('T')
answer.append('A')
answer.append('M')
ch=answer.pop()
output=output+ch
ch=answer.pop()
output=output+ch
ch=answer.pop()
output=output+ch
print("Result=",output)
Show solution
answer=[]; output=""
answer.append('T')
answer.append('A')
answer.append('M')
ch=answer.pop()
output=output+ch
ch=answer.pop()
output=output+ch
ch=answer.pop()
output=output+ch
print("Result=",output)
The list acts like a stack.
- After appending:
answer = ['T', 'A', 'M'] - First
pop()gives M →output = "M" - Second
pop()gives A →output = "MA" - Third
pop()gives T →output = "MAT"
So the output is Result= MAT.
Not sure why a step works? check your working in Super Tutor
Free with a Super Tutor account
((2+3)*(4/2))+2
Show step-by-step process for matching parentheses using stack data structure.
Free with a Super Tutor account
a) A B + C *
b) A B * C / D *
Free with a Super Tutor account
a) A + B - C * D
b) A * (( C + D)/E)
Free with a Super Tutor account
Free with a Super Tutor account
5 more solved questions in Stack
They are free with a Super Tutor account, along with practice quizzes and flashcards for this chapter. Free to start, no card needed.
Frequently Asked Questions
What are the important topics in Stack for CBSE Class 12 Computer Science?
Are these NCERT Solutions for Stack free?
How should I revise Stack for the CBSE Class 12 board exam?
Sources & Official References
- NCERT Official — ncert.nic.in
- CBSE Academic — cbseacademic.nic.in
- CBSE Official — cbse.gov.in
- National Education Policy 2020 — education.gov.in
Content is aligned to the official syllabus. Refer to the board website for the latest curriculum.
More resources for Stack
Practice Quiz
Test yourself with a quick quiz
Important Questions
Exam-style questions with answers
Revision Notes
Key points for last-minute revision
Formula Sheet
The chapter's formulas in one place
Chapter Summary
Understand the chapter at a glance
Concept Maps
See how topics connect
Study Plan
Step-by-step plan for this chapter
Flashcards
Quick-fire cards for active recall
Syllabus
What topics to cover
For serious students
Get the full Stack chapter — start free.
Quizzes, flashcards, an AI doubt solver and a study plan for CBSE Class 12 Computer Science. Free to start, no card needed.