Fix List to ArrayList
Add toString method for Box Add code to print the shortest path for this particular case.
This commit is contained in:
1 parent
fda73a2025
commit
d46b3c3b99
8 files changed
+19
-21
No files matched your search
@@ -2,8 +2,6 @@ package dijkstra;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
import maze.Box;
|
||||
|
||||
public class ASet implements ASetInterface {
|
||||
|
||||
private HashSet<VertexInterface> vertexHashSet = new HashSet<VertexInterface>() ;
|
||||
|
||||
@@ -2,16 +2,11 @@ package dijkstra;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Hashtable;
|
||||
import java.util.List;
|
||||
|
||||
import maze.Box;
|
||||
|
||||
public class Previous implements PreviousInterface {
|
||||
|
||||
private Hashtable<VertexInterface, VertexInterface> hashPrevious = new Hashtable<VertexInterface, VertexInterface>() ;
|
||||
private ArrayList<VertexInterface> shortestPath = new ArrayList<VertexInterface>() ;
|
||||
|
||||
|
||||
|
||||
public Previous(Hashtable<VertexInterface, VertexInterface> hashPrevious, ArrayList<VertexInterface> shortestPath) {
|
||||
|
||||
@@ -39,8 +34,7 @@ public class Previous implements PreviousInterface {
|
||||
if (getPrevious(father) == null) return shortestPath ;
|
||||
else {
|
||||
return getShortestPathTo(father) ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
package dijkstra;
|
||||
import java.util.List;
|
||||
|
||||
public interface VertexInterface {
|
||||
|
||||
|
||||
Reference in new issue
Block a user