Lab11/Assignment Part1.png Lab11/Assignment Part2.png Lab11/DistanceTo.java Lab11/DistanceTo.java public class DistanceTo implements Comparable { private String target; private int distance;...

I need help with my lab assignment for Java involving Priority Queues


Lab11/Assignment Part1.png Lab11/Assignment Part2.png Lab11/DistanceTo.java Lab11/DistanceTo.java public class DistanceTo implements Comparable {      private String target;      private int distance;           public DistanceTo(String city, int dist) {            target = city; distance = dist;      }           public String getTarget() {          return target;      }           public int getDistance() {          return distance;      }           public int compareTo(DistanceTo other) {           return distance - other.distance;      }  }  Lab11/map.txt Pendleton Pueblo 8 Pendleton Phoenix 4 Pendleton Pierre 2 Pensacola Phoenix 5 Pensacola Pittsburgh 4 Pensacola Princeton 5 Peoria Pueblo 3 Peoria Phoenix 4 Peoria Pittsburgh 5 Phoenix Pendleton 4 Phoenix Pueblo 3 Phoenix Peoria 4 Phoenix Pittsburgh 10 Phoenix Pensacola 5 Pittsburgh Phoenix 10 Pittsburgh Peoria 5 Pittsburgh Princeton 2 Pittsburgh Pensacola 4 Princeton Pittsburgh 2 Princeton Pensacola 5 Pierre Pueblo 3 Pierre Pendleton 2 Pueblo Phoenix 3 Pueblo Peoria 3 Pueblo Pendleton 8 Lab11/Routes.java Lab11/Routes.java // imports import java.util.HashMap; import java.util.Map; import java.util.HashSet; // class public class Routes {        // variables     private Map<>> routeMap;     private String inputFile;     private String startCity;     // Routes Constructor     public Routes(String fileName) {               // instantiate class variables         this.routeMap = routeMap;         this.inputFile = inputFile;         this.startCity = startCity;     }     public void populateFiles() {         // read map.txt to populate routeMap     }     public Map findShortestKnownDistance() {         // implement the algorithm using priority queue         Map shortestKnownDistance = new HashMap();                  return shortestKnownDistance;     }     public static void main(String[] args) {         // test your methods here     } }
Apr 15, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here