Consider the queues containing four elements and 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 required to place the elements of in in reverse order (shown as the Final State in the figure) without using any additional storage is __________.

GATE CS 2022 (Forenoon) — Question 62
Data StructuresAbstract Data Types (ADTs), Stacks, QueuesNAT2 marksMedium
A GATE question every morning
One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.
More on Abstract Data Types (ADTs), Stacks, Queues
- GATE CS 2026 (Afternoon) · Q50Consider a stack S and a queue Q . Both of them are initially empty and have the capacity to store ten elements each. The elements 1, 2, 3,…
- GATE CS 2025 (Afternoon) · Q45Consider a stack data structure into which we can PUSH and POP records. Assume that each record pushed in the stack has a positive integer…
- GATE CS 2024 (Afternoon) · Q48Let S1 and S2 be two stacks. S1 has capacity of 4 elements. S2 has capacity of 2 elements. S1 already has 4 elements: 100, 200, 300, and 40…
- GATE CS 2023 (Forenoon) · Q59Consider a sequence a of elements a 0 = 1, a 1 = 5, a 2 = 7, a 3 = 8, a 4 = 9, and a 5 = 2. The following operations are performed on a sta…
- GATE CS 2021 (Forenoon) · Q31Consider the following sequence of operations on an empty stack. push (54); push (52); pop ( ); push (55); push (62); s = pop ( ); Consider…
- GATE CS 2018 (Forenoon) · Q13A queue is implemented using a non-circular singly linked list. The queue has a head pointer and a tail pointer, as shown in the figure. Le…

