Talk:Tree from nesting levels: Difference between revisions

m
 
Line 72:
We can obtain a self-consistent representation of these forests as lists of tuples, in which the first value is a kind of sum type – in Python terms (None or integer), and the second value is itself a (possibly empty) forest.
 
A consistent recursive data structure: – lets give it a name like '''Node'''.
 
In Python terms, '''Node''' here is a tuple of a possible integer with a list of '''Nodes''':
<pre>Node (None|Int) :: ((None|Int), [Node])</pre>
<lang python>(None, [])
9,655

edits