Logo

Programming-Idioms

History of Idiom 17 > diff from v1 to v2

Edit summary for version 2 by :

Version 1

2015-05-06, 21:04:48

Version 2

2015-08-20, 15:44:53

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 his 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 his parent.

Code
struct Node(T){
    Node!T[] children;
    T data;
}