You can prepare effectively for Computer Science Engineering (CSE) GATE Computer Science Engineering(CSE) 2027 Mock Test Series with this dedicated MCQ Practice Test (available with solutions) on the important topic of "Test: Queues". These 15 questions have been designed by the experts with the latest curriculum of Computer Science Engineering (CSE) 2026, to help you master the concept.
Test Highlights:
Sign up on EduRev for free to attempt this test and track your preparation progress.
Following is C like pseudo code of a function that takes a Queue as an argument, and uses a stack S to do processing.
void fun(Queue *Q)
{
Stack S; // Say it creates an empty stack S
// Run while Q is not empty
while (!isEmpty(Q))
{
// deQueue an item from Q and push the dequeued item to S
push(&S, deQueue(Q));
}
// Run while Stack S is not empty
while (!isEmpty(&S))
{
// Pop an item from S and enqueue the poppped item to Q
enQueue(Q, pop(&S));
}
}
Q.
What does the above function do in general?
Detailed Solution: Question 1
Which one of the following is an application of Queue Data Structure?
How many stacks are needed to implement a queue. Consider the situation where no other data structure like arrays, linked list is available to you.
Detailed Solution: Question 3
How many queues are needed to implement a stack. Consider the situation where no other data structure like arrays, linked list is available to you.
Detailed Solution: Question 4
A priority queue can efficiently implemented using which of the following data structures? Assume that the number of insert and peek (operation to see the current highest priority item) and extraction (remove the highest priority item) operations are almost same.
Which of the following is true about linked list implementation of queue?
Detailed Solution: Question 6
Suppose a circular queue of capacity (n – 1) elements is implemented with an array of n elements. Assume that the insertion and deletion operation are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue full and queue empty are
Detailed Solution: Question 7
A Priority-Queue is implemented as a Max-Heap. Initially, it has 5 elements. The level-order traversal of the heap is given below: 10, 8, 5, 3, 2 Two new elements ”1‘ and ”7‘ are inserted in the heap in that order. The level-order traversal of the heap after the insertion of the elements is:
An implementation of a queue Q, using two stacks S1 and S2, is given below:
Q. Let n insert and m (<=n) delete operations be performed in an arbitrary order on an empty queue Q. Let x and y be the number of push and pop operations performed respectively in the process. Which one of the following is true for all m and n?
Detailed Solution: Question 9
The following C program is executed on a unix/Linux is:

The total number of child processes created is ______
Detailed Solution: Question 10
Consider the following pseudo code. Assume that IntQueue is an integer queue. What does the function fun do?
Detailed Solution: Question 11
Consider the following operation along with Enqueue and Dequeue operations on queues, where k is a global parameter.
Q. What is the worst case time complexity of a sequence of n MultiDequeue() operations on an initially empty queue?
Suppose implementation supports an instruction REVERSE, which reverses the order of elements on the stack, in addition to the PUSH and POP instructions. Which one of the following statements is TRUE with respect to this modified stack?
Detailed Solution: Question 13
A queue is implemented using an array such that ENQUEUE and DEQUEUE operations are performed efficiently. Which one of the following statements is CORRECT (n refers to the number of items in the queue)?
Detailed Solution: Question 14
Let Q denote a queue containing sixteen numbers and S be an empty stack. Head(Q) returns the element at the head of the queue Q without removing it from Q. Similarly Top(S) returns the element at the top of S without removing it from S. Consider the algorithm given below.

Q. The maximum possible number of iterations of the while loop in the algorithm is______
[This Question was originally a Fill-in-the-Blanks question]
Detailed Solution: Question 15