What does the dequeue operation do in a queue ?
2023
What does the dequeue operation do in a queue ?
- A.
Returns the number of elements present
- B.
Indicates whether the queue is empty or not
- C.
Removes the element at the front
- D.
Adds the element at the end
Attempted by 183 students.
Show answer & explanation
Correct answer: C
A queue is a First-In-First-Out (FIFO) data structure. The dequeue operation deletes or removes the element from the front of the queue, where elements have been residing the longest. Therefore, Option C is the correct answer.