228 views
0 votes
0 votes

( Its a doubt so dont mark it as duplicate )

 

https://gateoverflow.in/1776/gate2014-1-12?show=27673#a27673

In the above answer, if I ignored all the ancestors of current node with subtree node count exact 4 as they surely will not have exact 4 count. ( they will have count more than 4 )

So ignoring such ancestors , can I reduce the time complexity ? or it will still be O(n) only ?

Please explain.

 

Question : 

 

Please log in or register to answer this question.

Related questions

1 votes
1 votes
1 answer
1
0 votes
0 votes
2 answers
2
mohit kumar 5 asked Aug 18, 2017
403 views
What is ordered tree?