In a queue, where is the new element inserted ?
2023
In a queue, where is the new element inserted ?
- A.
Randomly
- B.
At the rear
- C.
In the middle
- D.
At the front
Attempted by 229 students.
Show answer & explanation
Correct answer: B
A queue follows the First-In-First-Out (FIFO) principle. In this structure, elements are always deleted from the front (dequeue) and new elements are inserted exclusively at the end or rear position (enqueue). Therefore, a new element is inserted at the rear. Correct option is B.