day1
This commit is contained in:
35
2025/go/utils/dijkstra/object.go
Normal file
35
2025/go/utils/dijkstra/object.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package dijkstra
|
||||
|
||||
type Point struct {
|
||||
X int
|
||||
Y int
|
||||
Label string
|
||||
}
|
||||
|
||||
type Node struct {
|
||||
Value Point
|
||||
}
|
||||
|
||||
type Edge struct {
|
||||
Node *Node
|
||||
Weight int
|
||||
}
|
||||
|
||||
type Vertex struct {
|
||||
Node *Node
|
||||
Distance int
|
||||
}
|
||||
|
||||
type PriorityQueue []*Vertex
|
||||
|
||||
type InputGraph struct {
|
||||
Graph []InputData
|
||||
From Point
|
||||
To Point
|
||||
}
|
||||
|
||||
type InputData struct {
|
||||
Source Point
|
||||
Destination Point
|
||||
Weight int
|
||||
}
|
||||
Reference in New Issue
Block a user