Which of the following operations is used to just return the first element of a queue?

By: Prof. Dr. Fazal Rehman | Last updated: February 3, 2024

Question:  Which of the following operations is used to just return the first element of a queue?

A   Enqueue

B   Dequeue

C    Peek

D    Push

Answer:     Peek

 

Name of operation           Description Example
Peek Returns the element at the front of the queue without removing it. Checking who is at the front of the queue without serving or removing them.
Enqueue Adds an element to the back (end) of the queue. Enqueueing a customer in a line: adding them to the end of the queue.
Dequeue Removes and returns the element at the front of the queue. Dequeueing a customer from a line: serving the customer at the front of the queue and removing them.
Push It adds an element to the top (or end) of a stack. Pushing a book onto a stack
All Copyrights Reserved 2025 Reserved by T4Tutorials