Hi everyone,

I'm trying to implement the Kruskal algorith in Java, I understand the algorithm completely but encounter some difficulties in implementing it, and believe me I have tried to read about it.
I would like to define a new class of elements that can define the graph, a bit like this:

public class Arete (int x, String a, String b) {
Arete.x=x; Arete.a=a; Arete.b = b;}

This is probably not correct but I was also wondering how you know what you to import, and if you import something, can you you use directly everything that's in it?

Thank you for your help, I know I'm a beginner but I really would like to learn and textbooks aren't helping a lot!


Instead of Arete use this.x=x;
Arete.someVariable is used when the variable is static