GATEverse Practice, past papers & mock tests
GATE 2022
Programming & Data StructuresStacks & QueueshardNAT2 marks
Consider the queues Q1 containing four elements (head to tail: 1, 2, 3, 4) and Q2 containing none (Initial State). The only operations allowed on these two queues are Enqueue(Q,element) and Dequeue(Q). The minimum number of Enqueue operations on Q1 required to place the elements of Q1 in Q2 in reverse order (Final State: Q2 head to tail: 4, 3, 2, 1) without using any additional storage is___________.
Save your progress

Related Programming & Data Structures PYQs