1
0

Initial Commit

This commit is contained in:
2021-03-28 20:25:57 +01:00
commit 3a721ac0b4
9 changed files with 127 additions and 0 deletions

23
directedGraph.go Normal file
View File

@@ -0,0 +1,23 @@
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++
}