Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Vertex
- {
- String name; //nazwa miasta
- int id; //identyfikator miasta
- HashMap<Vertex, Integer> list; //lista krawędzi, którymi można poruszać się z wierzchołka
- Vertex(String name)
- {
- this.name = name;
- this.list = new HashMap<Vertex, Integer>();
- this.id = 0;
- }
- Vertex(int id)
- {
- this.id = id;
- this.list = new HashMap<Vertex, Integer>();
- this.name = "";
- }
- void printVertex()
- {
- System.out.print(name+" "+id+": ");
- for(Vertex key: list.keySet())
- {
- System.out.print(key.id+" ");
- }
- System.out.println();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement