Time Left - 15:00 mins

GATE 2020 : Programming & Data Structures Quiz 7 (App update required to attempt this test)

Attempt now to get your rank among 575 students!

Question 1

Suppose a circular queue of capacity (n −1) elements is implemented with an array of n elements. Assume that the insertion and deletion operations 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

Question 2

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

Question 3

Consider the following operation along with Enqueue and Dequeue operations on queues, where k is a global parameter.

What is the worst case time complexity of a sequence of n queue operations on an initially empty queue?

Question 4

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 5

Consider a circular queue where the empty spaces are utilized in a queue in effective manner. Now circular queue maintains two pointers front and rear . What is the condition for the circular queue to be full ?

Question 6

The following function test takes argument a queue and uses stack to perform some function:

What does the function test do?
  • 575 attempts
  • 2 upvotes
  • 6 comments
Apr 16GATE & PSU CS