Logo

Programming-Idioms

History of Idiom 9 > diff from v31 to v32

Edit summary for version 32 by schuelermine:
[Haskell] Made it more readable and typeable

Version 31

2019-01-23, 17:30:24

Version 32

2019-06-07, 10:22:55

Idiom #9 Create a Binary Tree data structure

The structure must be recursive because left child and right child are binary trees too. A node has access to children nodes, but not to its parent.

Idiom #9 Create a Binary Tree data structure

The structure must be recursive because left child and right child are binary trees too. A node has access to children nodes, but not to its parent.

Code
data BT x = Ø | BT (BT x) x (BT x)
Code
data BT x = BEnd | BNode (BT x) x (BT x)