# tree.py class TreeNode(object): def __init__(self, x): def sorted_array_to_bst(nums): if not nums: return None mid_val = len(nums) // 2