Question: construct a full binary tree from a list of nodes in pre-order. The nodes are marked ‘i’ if they are inner nodes and are marked ‘l’ if they are leaf nodes.
Example given a list of nodes marked as (i, i, i, l, l, i, l, l, i, l, l), we need to construct a tree from those nodes so that the result looks like this:
Notice how all “l” nodes are leaf nodes and “i” nodes are inner nodes?
[Read More]