upd docstrings

This commit is contained in:
onyx-and-iris 2023-12-23 11:58:21 +00:00
parent 2814b12750
commit 35776a5470
3 changed files with 5 additions and 5 deletions

View File

@ -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)

View File

@ -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 {

View File

@ -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)