krishna14kant / Data-Structures-

hacktoberfest hacktoberfest2020 hacktoberfest-accepted
45 stars 481 forks source link

Create kruskals_algo.py #571

Open jahnaviT2003 opened 1 month ago

jahnaviT2003 commented 1 month ago
  1. Disjoint set: This class provides the find and union operations used to detect cycles.
  2. Kruskal's Algorithm: First, we convert the adjacency list to a list of edges, we then sort the edges by weight, Using the disjoint set, we process the edges and add them to the MST if they do not form a cycle
  3. Input Graph: The input graph() function accepts the user input to define the adjacency list graph.