Logo

Programming-Idioms

History of Idiom 17 > diff from v38 to v39

Edit summary for version 39 by andrepd:
New Caml implementation by user [andrepd]

Version 38

2019-09-26, 15:00:31

Version 39

2019-09-26, 17:05:52

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.

Code
type 'a Tree = 
	| Leaf of 'a
	| Node of 'a tree * 'a tree