Assignment for CSE Jan
Assignment for CSE Jan
2.
3.
4. Consider the following operations on a priority queue, where the priority of an element determines its
position:
enqueue(10, priority 3)
enqueue(20, priority 2)
enqueue(30, priority 1)
enqueue(40, priority 4)
Which of the following are correct about the state of the priority queue after all operations?**
7. In which of the following scenarios is a dequeue operation performed from both ends of a queue?
A. Simple Queue
B. Circular Queue
C. Priority Queue
D. Double-Ended Queue (Deque)
8. Which of the following statements about a minimum spanning tree (MST) is true?
A. An MST of a graph is unique if all edge weights are distinct.
B. An MST of a graph is unique regardless of edge weights.
C. An MST always contains the shortest edge in the graph.
D. The sum of degrees of all vertices in an MST is twice the number of edges in the MST.
10. Let G be a simple, connected, undirected graph with nnn vertices and mmm edges. What is the minimum
number of edges that need to be removed to make G acyclic?
A. n−1
B. m−n+1
C. 2m−n+2
D. m−(n−1)
12
13
14. If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted one at a time, in what order will they be
removed?
a) ABCD
b) DCBA
c) DCAB
d) DCAB
15. . Which of the following operations are NOT possible in a circular queue implemented using an array?