```
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def constructMaximumBinaryTree(self, nums):
"""
:type nums: List[int]
:rtype: TreeNode
"""
if len(nums) <= 0:
return None
root = TreeNode(max(nums))
maxIndex = nums.index(root.val)
root.left = self.constructMaximumBinaryTree(nums[:maxIndex])
root.right = self.constructMaximumBinaryTree(nums[maxIndex+1:])
return root
```