GATE CS 2022 | Question 62

Programming & Data Structures › Basics & Control Structures · NAT · 2 marks · Answer: 0

  1. Question 62Programming & Data Structuresnat2 marks
    Queue has four elements (1,2,3,4; 1 at head), empty. Only Enqueue and Dequeue are allowed. The minimum number of Enqueue operations on required to place 's elements into in reverse order without extra storage is __________.

    Answer: 0

    Solution

    Answer: 0 With only Enqueue/Dequeue on and (FIFO queues) and no additional storage, it is impossible to reverse the order of the elements — any sequence of moves preserves relative order. So the minimum number of enqueue operations that could achieve the reversal is 0 (the task cannot be done, hence no valid positive count).

More GATE PYQ on Basics & Control Structures

All GATE CS Programming & Data Structures PYQ →

Attempt GATE CS 2022 in real GATE exam mode

Full paper with a timer, the GATE interface and a topic-wise analysis — free.

Create free account →