Question: Given a non - empty queue initially containing the elements [ 2 , 4 ] with 2 at the front and 4 at the rear.

Given a non-empty queue initially containing the elements [2,4] with 2 at the front and 4 at the rear. Perform the following sequence of operations:
dequeue()
enqueue(5)
enqueue(3)
dequeue()
enqueue(1)
What elements are left in the queue from front to rear after completing the above operations?
Question 5 options:
1,3,5
2,5,1
1,5,2
5,3,1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!