public class Solution {

public TreeNode sortedArrayToBST(int[] num) {

int start = 0;

int end = num.length-1;

```
TreeNode n = this.getRootfromList(num,start,end);
return n;
//return (this.getRootFromList(num,start,end));
}
public TreeNode getRootfromList(int[] num, int start, int end)
{
if(start<= end) return null;
int mid = (start + end )/2 ;
TreeNode node = new TreeNode(num[mid]);
node.left = getRootFromList(num,start,mid-1);
node.right = getRootFromList(num,mid+1,end);
return node;
}
```

}