GATE CS 2022 · Arrays & Matrix Representation

NAT · 2 marks · Problem PROG-DSTR-0095

Consider the queues Q1 containing four elements and Q2 containing none (shown as the Initial State in the figure). 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 (shown as the Final State in the figure) without using any additional storage is

Numerical answer (NAT).

Solve it on GATE DA practice →More Basic Data Structures problems

Show the worked solutionOfficial GATE Answer Key: [0.0, 0.0].See full step-by-step discussion on GateOverflow: https://gateoverflow.in/371884/Gate-cse-2022-question-52

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com