I'm stuck with a computer science problem I'm trying to solve. Suppose you have a binary tree (which does not need to be balanced), where each node has at most two child nodes and where only a leaf can contain an integer value (the root and the middle nodes do not). We are given an array of values and have to construct such a tree with the constraint: