I have written binary search solution for the question SMARKET.
Here is my solution Binary_Search_Approach
Only four of the total test cases passed. Someone please point out the error I have done . I have documented my code, that might help you to know the logic for the code.
How did you approach the problem? Things like what did you stored and things. What lines of code correspond to your query and tree building function? I can try giving a look if its really bothering you.
This is basically a binary search approach. For that i have to make an array of b[ i have documented this in my code]. Then doing a binary search in the ArrayList index_dalo [ this is made using b array] using l and r.
Yes, it is really good question.
But I am not sure that you can find the answer on this forum.
You should search the info on the professional websites.