Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static EDListGraph<Character,Integer> readGraph (Scanner scan) {
- int size = scan.nextInt();
- EDListGraph graph = new EDListGraph(true);
- for(int i = 0; i < size; i++)
- graph.insertNode(scan.next());
- int cont = 0;
- while(scan.hasNextInt()) {
- for(int i = 0; i < size; i++) {
- if(scan.nextInt() == 1) { //Existe enlace
- EDEdge edge = new EDEdge(cont, i);
- graph.insertEdge(edge);
- }
- }
- cont++;
- }
- return graph;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement