Logo

Programming-Idioms

History of Idiom 9 > diff from v3 to v4

Edit summary for version 4 by :

Version 3

2015-08-22, 21:08:06

Version 4

2015-08-22, 23:16:46

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

Code
class Node<T> {
  final T value;
  Node<T> left, right;
  Node(this.value, {this.left, this.right});
]