Question 1 |

Consider 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 stack S and a queue Q, both
of which are initially empty.

I: push the elements of a from a_0 to a_5 in that order into S.

II: enqueue the elements of a from a_0 to a_5 in that order into Q.

III: pop an element from S.

IV: dequeue an element from Q.

V: pop an element from S.

VI: dequeue an element from Q.

VII: dequeue an element from Q and push the same element into S.

VIII: Repeat operation VII three times.

IX: pop an element from S.

X: pop an element from S.

The top element of S after executing the above operations is ___.

I: push the elements of a from a_0 to a_5 in that order into S.

II: enqueue the elements of a from a_0 to a_5 in that order into Q.

III: pop an element from S.

IV: dequeue an element from Q.

V: pop an element from S.

VI: dequeue an element from Q.

VII: dequeue an element from Q and push the same element into S.

VIII: Repeat operation VII three times.

IX: pop an element from S.

X: pop an element from S.

The top element of S after executing the above operations is ___.

7 | |

8 | |

9 | |

2 |

Question 1 Explanation:

Question 2 |

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

4 | |

2 | |

0 | |

1 |

Question 2 Explanation:

Question 3 |

A 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. Let n denote the number of nodes in the queue. Let enqueue be implemented by inserting a new node at the head, and dequeue be implemented by deletion of a node from the tail.

Which one of the following is the time complexity of the most time-efficient implementation of enqueue and dequeue, respectively, for this data structure?

Which one of the following is the time complexity of the most time-efficient implementation of enqueue and dequeue, respectively, for this data structure?

\Theta (1), \Theta (1) | |

\Theta (1), \Theta (n) | |

\Theta (n), \Theta (1) | |

\Theta (n), \Theta (n) |

Question 3 Explanation:

Question 4 |

Which of the following data structure is useful in traversing a given graph by breadth first search?

Stack | |

Queue | |

List | |

None of the above |

Question 4 Explanation:

Question 5 |

A circular queue has been implemented using a single linked list where each node consists of
a value and a single pointer pointing to the next node. We maintain exactly two external
pointers FRONT and REAR pointing to the front node and the rear node of the queue,
respectively. Which of the following statements is/are CORRECT for such a circular queue,
so that insertion and deletion operation can be performed in O (1) time ?

I. Next pointer of front node points to the rear node.

II. Next pointer of rear node points to the front node.

I. Next pointer of front node points to the rear node.

II. Next pointer of rear node points to the front node.

I only | |

II only | |

Both I and II | |

Neither I nor II |

Question 5 Explanation:

There are 5 questions to complete.

Ques – 7; option A will be correct, not D. Kindly check.

Thank You chayan kumar sengupta,

We have updated the option.

Question number 7 of queue is the correct option is option A ,q[0] . Please do change