Skip to content

Beta · Data may be lost.Your data may be reset or lost.

GateBrew
← GATE CSE 2022
Questions

Q52

NAT2 marksData structures

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.

Solutions and discussion are hidden while you attempt this question. They open once you check or show the answer.