convert sorted array to bstree