From 357a4441592669f47e74b5c385302ce0823446e8 Mon Sep 17 00:00:00 2001 From: papyrus <1+papyrus@noreply.localhost> Date: Mon, 18 May 2026 14:36:08 +0000 Subject: [PATCH] Delete kruskalMST.java --- kruskalMST.java | 81 ------------------------------------------------- 1 file changed, 81 deletions(-) delete mode 100644 kruskalMST.java diff --git a/kruskalMST.java b/kruskalMST.java deleted file mode 100644 index d76e54f..0000000 --- a/kruskalMST.java +++ /dev/null @@ -1,81 +0,0 @@ -import java.util.*; -public class kruskalMST{ - static class Edge implements Comparable{ - int u,v,weight; - Edge(int u, int v, int weight){ - this.u=u; - this.v = v; - this.weight = weight; - - } - public int compareTo(Edge other){ - return this.weight-other.weight; - } - } - static int[] parent; - - static int find(int x){ - if(parent[x]!=x) - parent[x] = find(parent[x]); - return parent[x]; - } - - static void union(int x, int y){ - int rootX = find(x); - int rootY = find(y); - - parent[rootY]= rootX; - } - public static void main(String[] args){ - Scanner sc = new Scanner(System.in); - System.out.print("ENter number of vertices: "); - int N = sc.nextInt(); - - int[][] graph = new int[N][N]; - - System.out.println("\nEnter adjacency matrix(0 if no edge): "); - for(int i =0;i edges = new ArrayList<>(); - for(int i =0;i