We can firstly do inorder traversal of this Balanced BST which will result in sorted list of elements. It will take O(n).
No we can perform binary search on this sorted list to find L and H. It will take O(logn).
After finding L and H. We will run a loop to sum all elements between L and H. As there are m elements between L and H. So it will take O(m).
So total =O(n)+O(logn)+O(m) {As m<=n and O(n+logn)>=O(n)}
Hence we get O(n)
So a=1,b=0,c=0,d=0
So a+10b+100c+1000d =1+0+0+0=1
I am getting confuse whether I am thinking right or wrong So Please help...