Talk:Tree from nesting levels: Difference between revisions

Content added Content deleted
Line 87: Line 87:
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 (Int or None), and the second value is itself a (possibly empty) forest:
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 (Int or None), and the second value is itself a (possibly empty) forest:


<lang python>[]
<lang python>(None, [])
[[(1, [(2, [(None, [(4, [])])])])]]
(None, [(1, [(2, [(None, [(4, [])])])])])
[[(None, [(None, [(3, [])])])], [(1, [(None, [(3, [])])])], [(1, [])]]
(None, [(None, [(None, [(3, [])])]), (1, [(None, [(3, [])])]), (1, [])])
[[(1, [(2, [(3, [])])])], [(1, [])]]
(None, [(1, [(2, [(3, [])])]), (1, [])])
[[(None, [(None, [(3, [])]), (2, [])])], [(1, [(None, [(3, [])])])]]
(None, [(None, [(None, [(3, [])]), (2, [])]), (1, [(None, [(3, [])])])])
[[(None, [(None, [(3, []), (3, []), (3, [])])])], [(1, [])], [(1, [(None, [(3, []), (3, []), (3, [])])])]]</lang>
(None, [(None, [(None, [(3, []), (3, []), (3, [])])]), (1, []), (1, [(None, [(3, []), (3, []), (3, [])])])])</lang>
[[User:Hout|Hout]] ([[User talk:Hout|talk]]) 14:00, 4 February 2021 (UTC)
[[User:Hout|Hout]] ([[User talk:Hout|talk]]) 14:00, 4 February 2021 (UTC)