---
type: "Chapter"
knowledge_type: "chapter"
entity_type: "chapter"
id: "66def9a93f8b4e9e69bdbda3"
title: "Queue"
board: "CBSE"
curriculum: "CBSE"
class: "Class 12"
subject: "Computer Science"
book: "Computer Science"
chapter: "Queue"
chapter_slug: "queue"
canonical_url: "https://www.edzy.ai/cbse-class-12-computer-science-queue"
markdown_url: "https://www.edzy.ai/okf/chapter/cbse-class-12-computer-science-queue.md"
source_type: "examSubjectBookChapter"
source_id: "66def9a93f8b4e9e69bdbda3"
source_pdf: "https://edzy-ai.s3.ap-south-1.amazonaws.com/edzy-express-ts/c388ee57-4f3d-4815-a0df-be88288667cd.pdf"
source: "Edzy"
version: 1
last_updated: "2026-06-20"
---

# Queue
This chapter explores the Queue data structure, which operates on the First-In-First-Out (FIFO) principle. Unlike previous chapters that discussed the Stack, which follows the Last-In-First-Out (LIFO) principle, the Queue allows orderly processing of elements, akin to real-life queuing scenarios such as waiting in line at a bank.

## Knowledge Snapshot
| Field | Details |
| :--- | :--- |
| Class | Class 12 |
| Subject | Computer Science |
| Book | Computer Science |
| Chapter | Queue |
| Pages | 59-67 |

## Chapter Summary
### Short Summary
The Queue is a linear data structure where elements are added at one end (Rear) and removed from the other (Front), following the FIFO principle. It finds applications in numerous real-life scenarios and computer science.

### Detailed Summary
In this chapter, we discuss the Queue data structure, characterized by its First-In-First-Out (FIFO) principle. The queue facilitates orderly processing, as demonstrated through various examples including trains and customer service calls. Key operations include enqueue (adding elements), dequeue (removing elements), and auxiliary operations such as isEmpty, peek, and isFull. Additionally, the chapter covers the implementation of Queue in Python, explaining functions for managing the queue, and explores the Deque structure, which allows insertion and deletion from both ends, thus serving as a more versatile structure.

## Topic-Wise Explanation
### Introduction to Queue
The Queue is defined by its FIFO nature, where the first element added is the first to be removed. Applications in daily life include queues for tickets and banks.

### Operations on Queue
Key operations include:
- **ENQUEUE**: Add an element at the rear.
- **DEQUEUE**: Remove an element from the front.
- **IS EMPTY**: Check if the queue is empty.
- **PEEK**: View the front element without removing it.
- **IS FULL**: Check if more elements can be added.

### Implementation of Queue using Python
In Python, a queue can be implemented using list structures with key functions like `enqueue`, `dequeue`, `isEmpty`, and `peek`. Example implementations and scenarios are provided.

### Introduction to Deque
A Deque (Double Ended Queue) allows insertion and deletion from both ends, providing greater flexibility compared to standard queues.

### Implementation of Deque using Python
Similar functions to those used in queue implementations are defined for Deque, including `insertFront`, `deletionRear`, and others to manage its operations effectively.

## Core Ideas
| Idea | Explanation |
| :--- | :--- |
| FIFO Principle | The first element inserted is the first one to be removed, similar to a line of customers. |
| Queue Operations | Key operations support managing elements within the data structure efficiently. |

## Key Concepts
| Concept | Meaning |
| :--- | :--- |
| Enqueue | The operation of adding an element to the rear of the queue. |
| Dequeue | The operation of removing an element from the front of the queue. |
| Deque | A data structure that allows insertion and deletion at both ends. |

## Important Points for Revision
* Queue is an ordered linear data structure.
* Elements are added at the REAR and removed from the FRONT.
* Queue operations follow FIFO principles.
* Python dynamically manages size, avoiding overflow.
* Deque allows more flexible operations than a standard queue.

## Practice Questions
### Short Answer Questions
1. What is the FIFO principle?
2. Describe the enqueue operation.
3. What happens when trying to dequeue from an empty queue?
4. List applications of queues in computer science.
5. Explain how Python implements a queue using lists.

### Long Answer Questions
1. Discuss the various operations that can be performed on a queue and their significance.
2. Explain the advantages of using Deque over Queue.
3. Write a Python program to demonstrate queue operations and their outputs.

## Source Attribution
| Field | Value |
| :--- | :--- |
| Source | Edzy |
| Reference Type | examSubjectBookChapter |
| Reference ID | 66def9a93f8b4e9e69bdbda3 |
| Canonical URL | https://www.edzy.ai/cbse-class-12-computer-science-queue |
| Markdown URL | https://www.edzy.ai/okf/chapter/cbse-class-12-computer-science-queue.md |
