Logo

Programming-Idioms

History of Idiom 9 > diff from v40 to v41

Edit summary for version 41 by chardan:
New Cpp implementation by user [chardan]

Version 40

2019-09-27, 10:16:29

Version 41

2019-09-28, 00:30:42

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
struct binary_tree
{
 binary_tree *left = nullptr, *right = nullptr;
};