We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 80b9bcc commit 7039aadCopy full SHA for 7039aad
day15/src/main/kotlin/org/adventofcode/App.kt
@@ -103,6 +103,9 @@ object PathFinder {
103
val destinationPoint = grid.lastPoint
104
val initTraversalEntry = TraversalEntry()
105
val traversedEntries = mutableMapOf(ORIGIN_POINT to initTraversalEntry)
106
+ // N.B. Probably should refactor open entries to be a priority queue to
107
+ // get O(logn) insert and remove versus sorting that cost O(nlogn). Makes
108
+ // a significant difference in performance for very large grids
109
val openEntries = mutableListOf(ORIGIN_POINT to initTraversalEntry)
110
111
while (openEntries.isNotEmpty()) {
0 commit comments