Which of the following operations is not supported by a queue?
Practice Questions
Q1
Which of the following operations is not supported by a queue?
Enqueue
Dequeue
Peek
Pop
Questions & Step-by-Step Solutions
Which of the following operations is not supported by a queue?
Step 1: Understand what a queue is. A queue is a data structure that follows the First In, First Out (FIFO) principle, meaning the first element added is the first one to be removed.
Step 2: Learn the basic operations of a queue. The two main operations are 'Enqueue' (to add an element to the end of the queue) and 'Dequeue' (to remove an element from the front of the queue).
Step 3: Identify the operation 'Pop'. The 'Pop' operation is used in stacks, which follow the Last In, First Out (LIFO) principle, meaning the last element added is the first one to be removed.
Step 4: Compare the operations. Since 'Pop' is used in stacks and not in queues, it is the operation that is not supported by a queue.