Queue · Class 12 · CBSE · Science Computer Science
Which principle is followed by a queue?
Practice question from Queue (Class 12 · CBSE · Science Computer Science), with the correct answer and a step-by-step solution.
easy · MCQ · Q-9FDB4F
Which principle is followed by a queue?
- A.LIFO (Last In, First Out)
- B.FIFO (First In, First Out)Correct answer
- C.Random access only
- D.Priority-based access only
Solution
A queue follows FIFO: the element inserted first is removed first. Insertion generally takes place at the rear, and deletion takes place at the front.
More from Queue
- 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))
- Explain how enqueue and dequeue operations can be implemented for a queue using a Python list. Also state what should happen when dequeue i…
- 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 r…
- What will be the output of the following Python code? q = [4, 8] def removeitem(q): if len(q) == 0: return "Underflow" return q.pop(0) prin…
Practise more Computer Science
Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.
Start practising freeFree to start · No credit card needed