( 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 :