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 SheetPractice questions
- Question 1Q-9FDB4FSee the answer and solution
Which principle is followed by a queue?
- A.LIFO (Last In, First Out)
- B.FIFO (First In, First Out)
- C.Random access only
- D.Priority-based access only
- Question 2Q-525CA3See the answer and solution
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))
- A.10 10
- B.20 20
- C.20 30
- D.30 30
- Question 3Q-01C3CFSee the answer and solution
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.
- Question 4Q-AF4DF7See the answer and solution
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?
- A.[12, 18, 25, 31]
- B.[18, 25, 31]
- C.[25, 31]
- D.[31, 25]
- Question 5Q-3F67AESee the answer and solution
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))
- A.4 8 Underflow
- B.8 4 Underflow
- C.4 8 0
- D.Underflow 4 8
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 freeFree to start · No credit card needed