Question
Which data structure is used in Primās Algorithm to
efficiently find the minimum edge connecting a vertex to the spanning tree?Solution
In Primās Algorithm, a Min-Heap (Priority Queue) is used to efficiently find and extract the minimum-weight edge connecting a vertex to the existing spanning tree. The Min-Heap allows quick updates to edge weights and ensures that the minimum-weight edge can be retrieved in O(logā”V) time, where V is the number of vertices. Steps: ⢠Initialize a Min-Heap with all vertices, starting with an arbitrary vertex having weight 0. ⢠Update the heap when shorter edges are discovered. ⢠Extract the vertex with the minimum edge weight, adding it to the Minimum Spanning Tree (MST). This data structure optimizes the algorithm's overall complexity to O(Elogā”V), making it suitable for dense graphs. Why Other Options Are Incorrect: 1. Binary Search Tree: Inefficient for handling dynamic updates and retrieval of minimum elements. 2. Adjacency List: Represents graph structure but does not facilitate edge selection. 3. Adjacency Matrix: Useful for graph representation but inefficient for edge extraction in MST. 4. Disjoint Set: Used in Kruskalās Algorithm to detect cycles, not for edge selection in Primās Algorithm. Min-Heaps are integral to Primās efficiency in handling dynamic graph traversal during MST construction.
Which of the following is true about the Round Robin (RR) CPU scheduling algorithm?
Which of the following is NOT a characteristic of the Internet of Things (IoT)?
The amortized time for inserting into a dynamic array (like C++ vector) is:
In a binary tree, if the number of leaf nodes is L, what is the number of nodes with two children?
A directed acyclic graph (DAG) has 10 vertices and 15 edges. What is the maximum possible number of topological orderings?
Which algorithm guarantees the shortest path in a graph with negative weights but no negative cycles?
Which sorting algorithm has an average-case time complexity of O(n log n) and is known for its efficiency, often using a divide-and-conquer approach?
Which algorithm guarantees minimum spanning tree and will produce a different tree depending on tie-breaking?
Which of the following is substring of āIXAMBEEā?
Which of the following is considered the strongest type of encryption method in modern cyber security practices?Ā Ā Ā Ā