History of Idiom 17 > diff from v28 to v29
Edit summary for version 29 by programming-idioms.org:
[Go] Slightly better demo
[Go] Slightly better demo
↷
Version 28
2016-12-04, 21:17:10
Version 29
2016-12-04, 21:20:29
Idiom #17 Create a Tree data structure
The structure must be recursive. A node may have zero or more children. A node has access to children nodes, but not to its parent.
Idiom #17 Create a Tree data structure
The structure must be recursive. A node may have zero or more children. A node has access to children nodes, but not to its parent.
Comments bubble
valueType is a type of value associated with current node.
Children is a slice of pointers.
Note that in Go you can call methods of pointer type *Tree even on a nil receiver (an empty tree).
Comments bubble
valueType is a type of value associated with current node.
Children is a slice of pointers.
Note that in Go you can call methods of pointer type *Tree even on a nil receiver (an empty tree).