1
0
This repository has been archived on 2024-09-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
PathFinding_in_Go/directedGraph.go
2021-03-28 20:25:57 +01:00

24 lines
353 B
Go

package main
const SIZE_GRAPH int = 10
type DirectedGraph struct {
count int
nodes [SIZE_GRAPH]Node
Head *Node
}
func (self *DirectedGraph) AddNode(node *Node) {
if self.count > SIZE_GRAPH {
panic("Graph has gotten too big")
}
if self.Head == nil && self.count == 0 {
self.Head = node
}
self.nodes[self.count] = *node
self.count++
}