Hi guys, I am looking for some help on this error of my code. The compiler says

Line 23: java.lang.StackOverflowError.

But I can't find the error. Could anyone give me some hints? Being a rookie on programming, might make stupid mistakes.

```
public class Solution {
public TreeNode sortedArrayToBST(int[] num) {
if(num == null || num.length == 0) return null;
return toBST(num, 0, num.length);
}
public TreeNode toBST(int[] arr, int i, int j){
if(i>=j) return null;
int mid = (i+j)/2;
TreeNode node = new TreeNode(arr[mid]);
node.left = toBST(arr, 0, mid);
node.right = toBST(arr, mid+1, arr.length);
return node;
}
}
```