Guest User

Untitled

a guest
Jan 22nd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. /** Do the search */
  2. private static void search(String[] args) {
  3. if (args.length != 2) {
  4. System.err.println(USAGE);
  5. return;
  6. }
  7.  
  8. int[] intArgs = convertArgs(args);
  9. int from = intArgs[0];
  10. int to = intArgs[1];
  11.  
  12. System.out.println("Path between " + from + " and " + to + ":");
  13. System.out.println(findPath(graph, from, to));
  14. }
  15.  
  16. /** Convert the arguments */
  17. private static int[] convertArgs(String[] args) {
  18. int[] intArgs = new int[args.length];
  19. for(int i = 0; i < args.length; i++) {
  20. intArgs[i] = Integer.parseInt(args[i]);
  21. }
  22.  
  23. return intArgs;
  24. }
Add Comment
Please, Sign In to add comment