Logo

Programming-Idioms

History of Idiom 17 > diff from v41 to v42

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

Version 41

2019-09-26, 19:52:40

Version 42

2019-09-27, 08:50:51

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 node_t
  integer:: value
  type(node_s), pointer :: next_sibling;
  type(node_s), pointer :: first_child;
end type node_t