In Kruskal's algorithm, the _______ data structure is often employed to efficiently detect cycles.

  • Disjoint-set
  • Heap
  • Queue
  • Stack
In Kruskal's algorithm, the disjoint-set data structure, also known as the union-find data structure, is often employed to efficiently detect cycles in the graph. This allows the algorithm to avoid adding edges that would create cycles in the minimum spanning tree.
Add your answer
Loading...

Leave a comment

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