convert sorted array to BST reimpl