Implemented Kruskal’s Minimum Spanning Tree (MST) algorithm in C++. This update introduces a new implementation that includes:
Edge Struct: Represents an edge in the graph with source, destination, and weight.
DisjointSet Class: Manages union-find operations to detect cycles and union sets efficiently.
kruskalMST Function: Computes the MST using Kruskal's algorithm and prints the edges included in the MST.
Flexible Input Options:
Static Input: A predefined adjacency matrix for ease of testing.
Dynamic Input: Allows users to input their own adjacency matrix and number of vertices.
The code now supports user interaction for dynamic input, provides clear error handling for invalid choices, and includes thorough documentation and comments for clarity.
[x] Search previous suggestions before making a new one, as yours may be a duplicate.
[x] I acknowledge that all my contributions will be made under the project's license.
Notes: This update provides a complete implementation of Kruskal’s algorithm with options for both static and dynamic input, improving usability and flexibility for testing.
Implemented Kruskal’s Minimum Spanning Tree (MST) algorithm in C++. This update introduces a new implementation that includes:
The code now supports user interaction for dynamic input, provides clear error handling for invalid choices, and includes thorough documentation and comments for clarity.
Checklist
Notes: This update provides a complete implementation of Kruskal’s algorithm with options for both static and dynamic input, improving usability and flexibility for testing.