doc(dijkstra): explain why we use an ArrayList
This commit is contained in:
父節點
e5be8087f9
當前提交
5dfd14f3f2
共有 1 個文件被更改,包括 2 次插入 和 0 次删除
|
|
@ -36,6 +36,8 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
|||
|
||||
// Init Dijkstra
|
||||
for (Node node : graph.getNodes()) {
|
||||
// Luckily they are ordered by id.
|
||||
// ArrayList.set only works if the value is already initialized (because why Java?)
|
||||
labels.add(new Label(node));
|
||||
}
|
||||
|
||||
|
|
|
|||
載入中…
Reference in a new issue