Time Left - 15:00 mins

GATE CS 2021 : Data Structure & Programming Quiz 7 (App update required to attempt this test)

Attempt now to get your rank among 650 students!

Question 1

What is the minimum number of stacks of size n required to implement a queue of size n?

Question 2

The following function test takes argument a queue and uses stack to perform some function:
void test(Queue *A)
{
Stack T;
while (!isEmpty(A))
push(&T, deQueue(A));
while (!isEmpty(&T))
enQueue(A, pop(&T));
}
What does the function test do?

Question 3

Consider a queue with two pointers i.e. front and rear. To utilize the space better, we use circular queue which uses the empty slot present in queue. Currently the status of queue is:

Front Pointer, F = 3

Rear Pointer, R = 5

Now 3 elements a , b and c are inserted in the circular queue and 2 elements are removed from queue. What is the final position of the front pointer ________.

Question 4

Which of the following is true about linked list implementation of queue?

Question 5

Consider an empty queue and a stack and perform following operations

1) Insert ‘a’ into queue

2) Insert ‘b’ into stack

3) Remove ‘b’ from stack

4) Insert ‘c’ into stack

5) Insert ‘b’ into queue

What will be the content of stack and queue respectively?

Question 6

If the MAX_SIZE is the size of the array used in the implementation of circular queue, array index start with 0, front point to the first element in the queue, and rear point to the last element in the queue. Which of the following condition specify that circular queue is FULL?
  • 650 attempts
  • 2 upvotes
  • 28 comments
Jul 26GATE & PSU CS