minimal binary search tree for a sorted array