Convert Sorted Array to Balanced Binary Search Tree (BST)
i tried but it not giving correct o/p
for example u can take the array 12345 sorted...so can anybody help me in this
BinaryTree* sortedArrayToBST(int arr[], int start, int end) {
if (start > end) return NULL;
// same as (start+end)/2, avoids overflow.
int mid = start + (end - start) / 2;
BinaryTree *node = new BinaryTree(arr[mid]);
node->left = sortedArrayToBST(arr, s...