0% found this document useful (0 votes)
2 views

Assignment for CSE Jan

The document consists of a series of questions related to data structures, specifically focusing on priority queues, minimum spanning trees, graph algorithms, and queue operations. It includes multiple-choice questions about the properties and behaviors of these data structures. The questions assess understanding of concepts such as priority determination, dequeue operations, and the uniqueness of minimum spanning trees.

Uploaded by

yaautube123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Assignment for CSE Jan

The document consists of a series of questions related to data structures, specifically focusing on priority queues, minimum spanning trees, graph algorithms, and queue operations. It includes multiple-choice questions about the properties and behaviors of these data structures. The questions assess understanding of concepts such as priority determination, dequeue operations, and the uniqueness of minimum spanning trees.

Uploaded by

yaautube123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Assignment - CSE

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?**

A. The element with the highest priority is at the front


B. The elements are arranged in decreasing order of priority
C. The queue is sorted based on the values of the elements
D. The element with priority 3 will be dequeued before the element with priority 2

5. In a priority queue, how is the priority of an element typically determined?

A. By the size of the element


B. By the value of the element
C. By the time at which the element was inserted
D. By the comparison of the element with other elements based on a specific criterion

6. What is the result of trying to dequeue from an empty queue?

A. The operation is successful, and no error is raised


B. The queue becomes full
C. An error, such as Underflow, is raised
D. The queue gets reset

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)

11.Dijkstra's algorithm cannot be applied directly to a graph if:


A. The graph is undirected.
B. The graph is directed.
C. The graph contains negative weight edges.
D. The graph has cycles.

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?

A. Deleting an element from the front


B. Inserting an element at the rear when the queue is full
C. Accessing the element at the front without removing it
D. Traversing all the elements in the queue

You might also like