I'm working on a project in the Go programming language where I need a tree structure and the ability to add nodes (alot of them) to the tree. Each node is a struct like the following:
type Node struct {
ip net.IP
nodes []Node
value int
}
The number of nodes each node can have is variable (between 1-4). An IP address (I'll searching for late) can be contained at the node, but most nodes will be nil for that element.
I can easily do this in other langues, but I need to find an efficient way of adding these nodes to a tree in Go.