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:
antograb committed 2017-12-10 17:08:54 +01:00
1 parent fda73a2025
commit d46b3c3b99
8 files changed
+19 -21

No files matched your search

+1 -7
View File
@@ -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) ;
}
}
}
}