I have an interesting task, but I have no clue how to solve it.
The minim binary tree M(a) for a given sequence a= (a1, . . . , an) without repeated elements is defined as follows: Be ai the minimal number of (a1, . . . , an), and then the root of M(a) is ai, its left subtree is M(a1, . . . , ai-1) and its right subtree is M(ai+1, . . . . , an). M(∅) is a empty tree. For a given sequence, construct a minimum tree in O(n). Notice that subtrees are also M so they have to follow the rules.
