GATEverse
← GATE CSE 2022

Q52

NAT2 marks

Consider the queues Q1Q_{1} containing four elements and Q2Q_{2} containing none (shown as the Initial State\textsf{Initial State} in the figure). The only operations allowed on these two queues are Enqueue (Q, element)\textsf{Enqueue (Q, element)} and Dequeue (Q).\textsf{Dequeue (Q)}. The minimum number of Enqueue\textsf{Enqueue} operations on Q1Q_{1} required to place the elements of Q1Q_{1} in Q2Q_{2} in reverse order (shown as the Final State\textsf{Final State} in the figure) without using any additional storage is________________.

Figure 1

Sign in to save attempts.

Loading…