implemented sorted array to balanced binary search tree