Using python syntax with below environment diagram, teacher taught us that there are 11 trees(orange boundary) in this diagram, including leaf.
It has been taught here,
lists are represented as a row of index-labeled adjacent boxes, one per element. Each box either contains a primitive value or points to a compound value. For example:
nested_list = [ [1, 2], , [[3, False, None],[4, lambda : 5]] ]
tree is either a single value called a leaf or a sequence of trees. Typically some type restriction is placed on the leaves. E.g a tree of numbers. For example:
tree = [ [1, , 3, ], [, [5,6]], 7 ]
In general, Can a tree have heterogeneous type data? for example: Can I say,
abc = [1, 2, 3, 4, lamda: 5] a tree with 5 leaves?
Note: Intention is to understand, whether tree can have heterogeneous type data