Construct a binary tree in a level-by-level fashion. You will be given an array of n elements, and you will construct a tree with root having array as the level, which has array as it left child, and array as its right child, and so on. Your function should return a pointer to the root of the constructed tree.
Node *construct(intarray, intn);
The definition of a Node is as follows.
structNode *left, *right;
Node* construct(intarray, intn);
5pt. $n = 1$
5pt. $n = 2$
10pt. $n = 3$
30pt. $n$ is no more than $100$.
50pt. $n$ is no more than $1000$.
It is easy to see that the left child of array[i] is array[2 * i + 1] and the right child is array[2 * i + 2], so it is easy to construct the tree recursively.