Logo

Programming-Idioms

History of Idiom 9 > diff from v41 to v42

Edit summary for version 42 by pompito:
New Fortran implementation by user [pompito]

Version 41

2019-09-28, 00:30:42

Version 42

2019-09-28, 06:03:51

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
type binary_tree
    integer :: value
    type(binary_tree), allocatable :: left
    type(binary_tree), allocatable :: right
end type binary_tree