Python solution
\nclass Solution(object):\n    def sortedArrayToBST(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: TreeNode\n        """\n        if 
```\nclass Solution(object):\n    def sortedArrayToBST(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: TreeNode\n        """\n        if not nums:\n            return\n        n = len(nums)\n        if n == 1:\n            return TreeNode(nums[0])\n        elif n == 2:\n            root = TreeNode(nums[0])\n            right = TreeNode(nums[1])\n            root.right = right\n            return root\n        mid = n / 2\n        root = TreeNode(nums[mid])\n        left = self.sortedArrayToBST(nums[:mid])\n        right = self.sortedArrayToBST(nums[mid+1:])\n        root.left = left\n        root.right = right\n        return root\n```
[]