mirror of
https://github.com/onyx-and-iris/aoc2023.git
synced 2024-11-21 09:50:48 +00:00
upd docstrings
This commit is contained in:
parent
2814b12750
commit
35776a5470
@ -44,7 +44,7 @@ func (d dijkstra) initialize(start coords) *pqueue {
|
||||
return pq
|
||||
}
|
||||
|
||||
// run performs the lowest cost dijkstra algorithm with a min heap
|
||||
// run performs the lowest cost dijkstra algorithm from start to end
|
||||
func (d dijkstra) run(start, end coords) int {
|
||||
pq := d.initialize(start)
|
||||
|
||||
@ -101,7 +101,7 @@ func (d dijkstra) run(start, end coords) int {
|
||||
return 0
|
||||
}
|
||||
|
||||
// one returns the lowest cost path from start to end
|
||||
// one returns the lowest cost path for the given graph from start to end coords
|
||||
func one(lines []string) int {
|
||||
graph := buildGraph(lines)
|
||||
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"container/heap"
|
||||
)
|
||||
|
||||
// pqueue implements the heap.Interface interface
|
||||
// it represents a min heap priority queue
|
||||
// pqueue represents a min priority queue
|
||||
// it implements the heap.Interface interface
|
||||
type pqueue []*node
|
||||
|
||||
func newPriorityQueue() *pqueue {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package main
|
||||
|
||||
// two returns the lowest cost path from start to end
|
||||
// two returns the lowest cost path for a given graph from start to end coords
|
||||
// with a min/max distance set
|
||||
func two(lines []string) int {
|
||||
graph := buildGraph(lines)
|
||||
|
Loading…
Reference in New Issue
Block a user