What happens if you try to dequeue from an empty queue ?

TPSC Computer/IT Posts 2024

What happens if you try to dequeue from an empty queue ?

  1. A.

    It returns the last element added.

  2. B.

    It throws an error or exception.

  3. C.

    It returns a special value indicating emptiness.

  4. D.

    It dequeues the next element, regardless of emptiness.

Attempted by 719 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…