```
public static TreeNode SortedArrayToBST(int[] nums)
{
return Insertion(nums, 0, nums.Length - 1);
}
public static TreeNode Insertion(int[] nums, int start, int end)
{
if (start > end) return null;
int middle = start + (end - start) / 2;
TreeNode node = new TreeNode(nums[middle]);
node.left = Insertion(nums, start, middle - 1);
node.right = Insertion(nums, middle+1, end);
return node;
}
```