GATE CS 2022 (Forenoon) — Question 62

Data StructuresAbstract Data Types (ADTs), Stacks, QueuesNAT2 marksMedium

Consider the queues \(Q_1\) containing four elements and \(Q_2\) 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 \(Q_1\) required to place the elements of \(Q_1\) in \(Q_2\) in reverse order (shown as the Final State in the figure) without using any additional storage is __________.
Question image
Practise the full 2022-FN paper
Challenge a friend: WhatsApp Telegram
Recommended book · affiliate linkIntroduction to Algorithms (CLRS)The standard reference behind most GATE algorithm questions.
Practise more on Abstract Data Types (ADTs), Stacks, QueuesTimed, in the real exam interface · free to start

A GATE question every morning

One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.

Join
Stuck? Ask in the student group