Courses
Courses for Kids
Free study material
Offline Centres
More
Store Icon
Store

Class 12 Computer Science Chapter 4 Queue – NCERT Solutions & Answers

ffImage
banner

Stepwise Solutions for Class 12 Computer Science Chapter 4 Queue (CBSE 2025–26)

Confused about queues in data structures? Our NCERT Solutions for Class 12 Computer Science Chapter 4 Queue help you unravel every concept step by step, tailored for the CBSE 2025–26 exam format. Each answer is designed with your understanding and scoring in mind.


From exercise-wise solutions to neat diagram labelling, these resources cover back exercises, key definitions, and detailed explanations. If you're searching for queue class 12 question solutions or a free PDF, everything's here to save your time and boost clarity.


Stay ahead with stepwise answers, CBSE marking scheme tips, and important questions—all crafted for easy revision and exam confidence. Let's make scoring high in Computer Science Chapter 4: Queue simpler and stress-free together!


Stepwise Solutions for Class 12 Computer Science Chapter 4 Queue (CBSE 2025–26)

NCERT Solutions Class 12 Computer Science Chapter 4 Queue (2025-26)

1. Fill in the blank


  1. ____________ is a linear list of elements in which insertion and deletion takes place from different ends.
  2. Operations on a queue are performed in __________ order.
  3. Insertion operation in a queue is called __________ and deletion operation in a queue is called ____________.
  4. Deletion of elements is performed from __________ end of the queue.
  5. Elements ‘A’,’S’,’D’ and ‘F’ are present in the queue, and they are deleted one at a time, ________________ is the sequence of element received.
  6. ___________ is a data structure where elements can be added or removed at either end, but not in the middle.
  7. A deque contains ‘z’,’x’,’c’,’v’ and ‘b’. Elements received after deletion are ‘z’,’b’,’v’,’x’ and ‘c’. ________________ is the sequence of deletion operation performed on deque.
  1. Answer: Queue
  2. Answer: FIFO
  3. Answer: enqueue, dequeue
  4. Answer: front
  5. Answer: ‘A’, ‘S’, ‘D’, ‘F’
  6. Answer: Deque
  7. Answer: deletionFront(), deletionRear(), deletionRear(), deletionFront(), deletionFront()

2. Compare and contrast queue with stack.


Answer: A queue operates on the First-In-First-Out (FIFO) principle, where insertion (enqueue) happens at the rear and deletion (dequeue) at the front. In contrast, a stack works on Last-In-First-Out (LIFO) principle, with both insertion (push) and deletion (pop) at the top end. Thus, a queue is like a line, while a stack is like a pile.


3. How does FIFO describe queue?


Answer: FIFO (First-In-First-Out) means the element inserted earliest in the queue is removed first. In a queue, elements are always added at the rear and removed from the front, so the oldest element exits before newer ones, following FIFO order.


4. Write a menu driven Python program using queue, to implement movement of shuttlecock in its box.


Answer:

queue = []

def display_queue():
    if not queue:
        print("Queue is empty")
    else:
        print("Current queue:", queue)

def enqueue(item):
    queue.append(item)

def dequeue():
    if queue:
        removed = queue.pop(0)
        print("Removed", removed, "from the queue")
    else:
        print("Queue is empty, cannot remove")

while True:
    print("\nMENU:")
    print("1. Add movement to the queue")
    print("2. Remove movement from the queue")
    print("3. Display current queue")
    print("4. Exit")
    choice = input("Enter your choice (1-4): ")

    if choice == '1':
        movement = input("Enter the movement (up/down): ")
        enqueue(movement)
        print("Added", movement, "to the queue")
    elif choice == '2':
        dequeue()
    elif choice == '3':
        display_queue()
    elif choice == '4':
        print("Exiting program...")
        break
    else:
        print("Invalid choice, please try again")

5. How is queue data type different from deque data type?


Answer: A queue allows insertion at one end (rear) and removal from the other end (front) only. Deque (double-ended queue) allows insertion and deletion from both ends, providing more flexibility in handling data from either end.


6. Show the status of queue after each operation:

  • enqueue(34)
  • enqueue(54)
  • dequeue()
  • enqueue(12)
  • dequeue()
  • enqueue(61)
  • peek()
  • dequeue()
  • dequeue()
  • dequeue()
  • dequeue()
  • enqueue(1)

Answer:

  • [] → [34]
  • [34] → [34, 54]
  • [34, 54] → [54]
  • [54] → [54, 12]
  • [54, 12] → [12]
  • [12] → [12, 61]
  • [12, 61] → PEEK = 12
  • [12, 61] → [61]
  • [61] → []
  • [] → Underflow (queue empty)
  • [] → Underflow (queue empty)
  • [] → [1]

7. Show the status of deque after each operation:

  • peek()
  • insertFront(12)
  • insertRear(67)
  • deletionFront()
  • insertRear(43)
  • deletionRear()
  • deletionFront()
  • deletionRear()

Answer:

  • [] → peek = Queue empty
  • [] → [12]
  • [12] → [12, 67]
  • [12, 67] → [67]
  • [67] → [67, 43]
  • [67, 43] → [67]
  • [67] → []
  • [] → Underflow (deque empty)

8. Write a Python program to check whether the given string is palindrome or not, using deque. (Hint : refer to algorithm 4.1)

Answer:

def Deque():
    return []

def addRear(deque, ch):
    deque.append(ch)

def removeFront(deque):
    if len(deque) == 0:
        return None
    return deque.pop(0)

def removeRear(deque):
    if len(deque) == 0:
        return None
    return deque.pop()

def palchecker(aString):
    chardeque = Deque()
    for ch in aString:
        addRear(chardeque, ch)
    while len(chardeque) > 1:
        first = removeFront(chardeque)
        last = removeRear(chardeque)
        if first != last:
            return False
    return True

string1 = input("Enter a string: ")
pal = palchecker(string1.lower())
if pal:
    print(string1, "is a palindrome.")
else:
    print(string1, "is not a palindrome.")

NCERT Solutions Class 12 Computer Science Chapter 4 Queue – Key Concepts and Benefits

Mastering queue and deque data structures from the NCERT Solutions Class 12 Computer Science Chapter 4 Queue (2025-26) builds a solid programming foundation. These concepts are essential for coding interviews and CBSE board exams.


Focus on practice with FIFO operations and Python implementation. By working through the NCERT exercises, students improve logical thinking and hone skills necessary for real-world problem-solving.


Review exercise-based solutions regularly to reinforce your learning and boost your exam strategy. Consistent practice of these solutions will help you secure high marks in your CBSE Class 12 board exams.


FAQs on Class 12 Computer Science Chapter 4 Queue – NCERT Solutions & Answers

1. What is queue class 12th?

A queue in Class 12 Computer Science refers to a linear data structure that follows the First In, First Out (FIFO) principle.
- Elements are inserted at the rear and removed from the front.
- It is used in various applications like scheduling, buffering, and resource management.
- Types include simple queue, circular queue, and priority queue.
- Understanding the queue’s operations, like enqueue (insertion) and dequeue (deletion), is essential for CBSE and NCERT exam questions.

2. What are NCERT Solutions for Class 12 Computer Science Chapter 4 Queue?

NCERT Solutions for Class 12 Computer Science Chapter 4 Queue provide stepwise answers to all questions in the textbook based on the latest CBSE syllabus.
- Includes intext, back exercise, and exemplar solutions.
- Covers definitions, diagram labelling, and code logic.
- Solutions are structured for exam marking schemes and CBSE 2025–26 requirements.
- Helpful for revision, improving answer accuracy, and scoring better marks in exams.

3. How to write stepwise NCERT answers to score full marks in Computer Science Chapter 4 Queue?

To score full marks in Chapter 4 Queue, follow these structured answer writing steps:
- Start with a clear definition or introduction.
- Use stepwise explanations for operations (like enqueue and dequeue).
- Include neat diagrams wherever required.
- Label all parts of the diagram correctly.
- Use relevant keywords (FIFO, front, rear, overflow, underflow).
- Structure long answers with step points and brief explanations.
- Check the CBSE marking scheme to cover all required points.

4. Is a diagram or definition mandatory in Class 12 Computer Science Queue answers?

Including a diagram or definition in Queue-related answers is highly recommended and often required by CBSE marking schemes.
- Always provide a clear, labelled diagram for questions on data structures or explanation of operations.
- Start answers with a brief, accurate definition of the queue.
- Diagrams help earn step marks and make your answer stand out.
- For definitions, use NCERT wording wherever possible for accuracy.

5. Which are the most important topics in Class 12 Computer Science Chapter 4 Queue for exams?

The most important topics frequently asked in CBSE exams from Chapter 4 Queue are:
- Definition and characteristics of Queue
- Types of Queue (Simple, Circular, Priority)
- Queue operations (Enqueue, Dequeue)
- Applications of Queue in real life
- Queue implementation using arrays and linked lists
- Code-based questions related to queue operations
- Common errors like overflow and underflow
Ensure you cover each of these with stepwise explanations and diagrams.

6. Where can I download the Class 12 Computer Science Chapter 4 Queue solutions PDF?

You can download the Class 12 Computer Science Chapter 4 Queue NCERT Solutions PDF from reputed educational platforms.
- Look for a single-click download button labelled as “Free PDF Download” on NCERT solutions pages.
- Offical sites like Vedantu, CBSE, and NCERT provide syllabus-aligned content.
- Using downloaded PDFs helps with offline study and last-minute revision.

7. Do examiners award partial marks for correct steps even if the final answer is wrong?

Yes, CBSE examiners often award partial marks for correct steps shown, even if the final answer is incorrect.
- Use a stepwise approach to problem solving.
- Each correct logic step, diagram label, or keyword fetches step marks.
- This approach helps maximise your score in Computer Science exams as per the marking scheme guidelines.

8. How to structure long answers in Computer Science Chapter 4 Queue for better marks?

For long answer questions in Class 12 Computer Science Queue:
- Begin with an introduction sentence.
- Divide your answer into logical steps or subheadings (like definition, types, operations).
- Use bulleted or numbered points for clarity.
- Insert diagrams and code snippets where needed.
- Conclude with a summary or application to reinforce your understanding.
- Always cover all aspects asked in the question to align with CBSE marking.

9. What is the syllabus of class 12 computer science (CBSE 2025–26)?

The CBSE Class 12 Computer Science syllabus 2025–26 includes:
- Data Structures (Stack, Queue, Linked List)
- Programming in Python (OOP, functions, file handling)
- Database and SQL
- Boolean Algebra
- Communication and Networking
- Ensure you check the official CBSE and NCERT sites for exact chapter lists and weightage.

10. Where to find revision notes and important questions for Computer Science Chapter 4 Queue?

You can find revision notes and important questions for Class 12 Computer Science Chapter 4 Queue on educational websites.
- Look for platforms offering chapterwise notes and exam-focused questions.
- Notes should cover definitions, diagram tips, common mistakes, and key operations.
- Practicing important questions prepares you for expected CBSE exam patterns.
- Use revision planners and quick notes for last-minute preparation.