https://ide.geeksforgeeks.org/YfVtDkyHeF
this is the link to the code and I don’t understand the error in it
https://ide.geeksforgeeks.org/YfVtDkyHeF
this is the link to the code and I don’t understand the error in it
@arjun_121 you are building it normally but you have to build by calculating mid and all(it should be balanced)
Prateek Bhaiya had taught this way.So why it is needed to be implementd the other way.
I have also read that approach but Prateek Bhaiya has taught this method and it also a simple and better approach according to me . So why this is not working.
@arjun_121 yes but there are diff type of ways to build it you have to do it acc to the question statement
if output given is sorted like in this case you cant build normally as it will form a skewed tree (ineffecient)
you mean that if input is in sorted order we need to implement the other approach
@arjun_121 no i was saying that to tell you that it is not better app everytime.
you have to build acc to the problem statement everytime
thanks I understood that how it will form a skewed tree. I will implement the other method . Thanks a lot.
you are welcome 