Chapter 6 · Class 12 · CBSE · Science Computer Science

Queue

25 practice questions · 5 marks weightage

Topics in this chapter

  • Queue Principles and Operations
  • Python List Queue Implementation
  • Array and Circular Queue Mechanics
  • Linked Queue Pointers
  • Queue Applications

Cheat sheet

Cheat Sheet

Practice questions

  1. Question 1Q-9FDB4F

    Which principle is followed by a queue?

    1. A.LIFO (Last In, First Out)
    2. B.FIFO (First In, First Out)
    3. C.Random access only
    4. D.Priority-based access only
    See the answer and solution
  2. Question 2Q-525CA3

    What will be printed by the following Python code? q = []; q.append(10); q.append(20); q.pop(0); q.append(30); print(q[0], q.pop(0))

    1. A.10 10
    2. B.20 20
    3. C.20 30
    4. D.30 30
    See the answer and solution
  3. Question 3Q-01C3CF

    Explain how enqueue and dequeue operations can be implemented for a queue using a Python list. Also state what should happen when dequeue is attempted on an empty queue.

    See the answer and solution
  4. Question 4Q-AF4DF7

    A queue currently contains [12, 18, 25], where 12 is at the front. After one dequeue, one enqueue of 31, and one more dequeue, which list represents the queue from front to rear?

    1. A.[12, 18, 25, 31]
    2. B.[18, 25, 31]
    3. C.[25, 31]
    4. D.[31, 25]
    See the answer and solution
  5. Question 5Q-3F67AE

    What will be the output of the following Python code? q = [4, 8] def remove_item(q): if len(q) == 0: return "Underflow" return q.pop(0) print(remove_item(q), remove_item(q), remove_item(q))

    1. A.4 8 Underflow
    2. B.8 4 Underflow
    3. C.4 8 0
    4. D.Underflow 4 8
    See the answer and solution

20 more questions on Queue

Sign up free to practise the full chapter. Questions you get wrong come back until you've mastered them.

Start practising free

Free to start · No credit card needed