Created
November 12, 2017 18:33
-
-
Save mattpetters/00660c8cc0b5ebc23a0dbd154459555b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while (sc.hasNextLine()){ | |
String line = sc.nextLine(); | |
if (line.isEmpty()){ | |
continue; | |
} else { | |
String node = nextLine; | |
String anotherLine = sc.nextLine(); | |
while (!anotherLine.isEmpty()) { | |
String[] neighborInfo = anotherLine.split("\\s+"); | |
String neighborNode = neighborInfo[1]; | |
int edgeWeight = Integer.parseInt(neighborInfo[2]); | |
anotherLine = sc.nextLine(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment