Question DSA-QUE-0017
HardA queue initially holds 1, 2, 3, 4, 5 (front to back). Two operations are repeated 3 times: dequeue x, then enqueue x. What is at the front?
- A.
3
- B.
5
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Queues and Deques question
A queue initially holds 1, 2, 3, 4, 5 (front to back). Two operations are repeated 3 times: dequeue x, then enqueue x. What is at the front?
3
5
Sign up free to see the answer and a step-by-step explanation.
4
1