mirror of
https://github.com/onyx-and-iris/aoc2023.git
synced 2024-11-21 18:00:47 +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
|
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 {
|
func (d dijkstra) run(start, end coords) int {
|
||||||
pq := d.initialize(start)
|
pq := d.initialize(start)
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ func (d dijkstra) run(start, end coords) int {
|
|||||||
return 0
|
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 {
|
func one(lines []string) int {
|
||||||
graph := buildGraph(lines)
|
graph := buildGraph(lines)
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@ import (
|
|||||||
"container/heap"
|
"container/heap"
|
||||||
)
|
)
|
||||||
|
|
||||||
// pqueue implements the heap.Interface interface
|
// pqueue represents a min priority queue
|
||||||
// it represents a min heap priority queue
|
// it implements the heap.Interface interface
|
||||||
type pqueue []*node
|
type pqueue []*node
|
||||||
|
|
||||||
func newPriorityQueue() *pqueue {
|
func newPriorityQueue() *pqueue {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package main
|
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
|
// with a min/max distance set
|
||||||
func two(lines []string) int {
|
func two(lines []string) int {
|
||||||
graph := buildGraph(lines)
|
graph := buildGraph(lines)
|
||||||
|
Loading…
Reference in New Issue
Block a user