CBSE Class 12

Computer Science

04 Queue

30
Total
0
Attempted
0
Correct
0
Wrong
00:00:00
Q-1
Consider the following Python implementation of a queue using a list. What will be printed?
Medium Implementation of Queue using Python
Reference Code
```python
q = []
q.append(10)
q.append(20)
q.append(30)
q.pop(0)
print(q)
A [20, 30]
B [10, 20]
C [30]
D [10, 30]
Answer: [20, 30]
Explanation: append() inserts elements at rear. pop(0) removes the first element (10), leaving [20,30].