|
visited.put(pos, visited.get(element + 1)); |
Shouldn't the above line instead be: visited.put(pos, visited.get(element) + 1);
Note the placement of the + 1
In your code it is the part of the visited.get() call, whereas I'm suggesting it should be outside the visited.get() call.
Please correct me if I'm mistaken. I'm just trying to make sense of the code.
coursework/topic7_graphs/SnakesAndLadders.java
Line 42 in f5bf7ee
Shouldn't the above line instead be:
visited.put(pos, visited.get(element) + 1);Note the placement of the
+ 1In your code it is the part of the
visited.get()call, whereas I'm suggesting it should be outside thevisited.get()call.Please correct me if I'm mistaken. I'm just trying to make sense of the code.