NCERT Class 12 Computer Science Computer Science: Chapter 3 — Stack
This chapter introduces the concept of data structures, explaining how they organize and store data for efficient access and processing. It highlights Python's built-in data types like String and List as examples of sequence data structures. The chapter then focuses on the Stack, a linear data structure that follows the Last-In-First-Out (LIFO) principle. Analogies like piles of books or plates are used to illustrate how elements are added and removed exclusively from the top. The importance of learning stacks and queues, despite not being directly available in Python, is emphasized due to their widespread use in programming. This foundational knowledge is crucial for students' understanding of computer science principles and CBSE curriculum.
Quick info
| Board | CBSE / NCERT |
|---|---|
| Class | Class 12 |
| Subject | Computer Science |
| Book | Computer Science |
| Chapter | Chapter 3 — Stack |
| Language | English |
| PDF type | NCERT Textbook |
| Session | CBSE 2026 |
| Reading time | 3 minutes |
| Word count | 523 |
Learning outcomes
- Understand the concept of data structures and their importance.
- Define and explain the LIFO principle of a stack.
- Identify real-world analogies for stacks.
- Recognize the significance of stacks in programming.
Vocabulary
| Word | Meaning |
|---|---|
| Data structure | A mechanism to store, organise, and access data along with operations. |
| Linear data structure | A data structure in which elements are organised in a sequence. |
| Stack | A data structure following the Last-In-First-Out (LIFO) principle. |
| LIFO | Last-In-First-Out; the most recently added element is the first to be removed. |
| Top of the stack | The end from which elements are added or removed in a stack. |
The complete chapter text is read in the official NCERT PDF viewer below (streamed from ncert.nic.in). This page provides NCERT Help study material — summary, vocabulary, practice questions, and FAQs — not a full reproduction of the textbook.
Read chapter online
This PDF is loaded from the official NCERT website (ncert.nic.in). Use the page buttons below to read — download is disabled on NCERT Help.
Read page by page below. PDF is streamed from the official NCERT website — no download button on this page.
Practice questions
- What is a data structure? Answer: A data structure defines a mechanism to store, organise, and access data along with operations that can be efficiently performed on the data.
- What principle does a stack follow? Answer: A stack follows the Last-In-First-Out (LIFO) principle.
- Give an example of a real-world stack. Answer: A pile of books in a library or a stack of plates at home.
- Where are elements added or removed from in a stack? Answer: Elements are added or removed from the top of the stack.
Practice MCQs
Q1. Which of the following is NOT a sequence data type mentioned in the chapter?
Explanation: The chapter mentions String, List, and Tuple as sequence data types. Set is a collection data type but not strictly a sequence in the same way.
Q2. The principle followed by a stack is:
Explanation: A stack operates on the Last-In-First-Out (LIFO) principle, meaning the last element added is the first one to be removed.
Q3. In a stack, elements are added and removed from:
Explanation: In a stack, new elements are added and existing elements are removed from the same end, which is commonly referred to as the 'top' of the stack.
Q4. Which of these is an example of a stack?
Explanation: A pile of plates is a common real-world analogy for a stack, where new plates are added to the top and removed from the top.
Q5. A data structure that organizes multiple elements for efficient operations is called a:
Explanation: The chapter defines a data structure as a mechanism to store, organize, and access data along with operations that can be efficiently performed on it.
Frequently asked questions
What is a data structure?
A data structure is a way of organizing and storing data in a computer so that it can be accessed and modified efficiently.
What does LIFO stand for in the context of stacks?
LIFO stands for Last-In-First-Out, meaning the last element added to the stack is the first one to be removed.
Can stacks be directly used in Python?
While Python does not have a built-in stack data type, the concept is important and can be implemented using lists or other structures.
What are some real-world examples of stacks?
Real-world examples include a pile of books, a stack of plates, or the undo function in software.
Why is it important to learn about stacks?
Stacks are fundamental data structures used extensively in various programming applications and algorithms.
Related resources
Important topics
Topics covered
NCERT Class 12 Computer Science — Computer Science — Chapter 3 — Stack. Verified by NCERT Help Editorial Team. Reviewed on 29 Jul 2026. Last updated 10 Aug 2026.