In Kruskal's algorithm, what data structure is commonly used to efficiently determine if adding an edge will create a cycle?

  • Disjoint Set (Union-Find)
  • Priority Queue
  • Queue
  • Stack
In Kruskal's algorithm, a Disjoint Set, also known as Union-Find, is commonly used to efficiently determine if adding an edge will create a cycle in the graph. This data structure helps in maintaining disjoint sets and quickly checking whether two vertices belong to the same set, enabling the algorithm to avoid adding edges that would create cycles.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *