Objective: – Given Binary Tree, Print All The Nodes Which are X distance from the Given Node.
Example :
Approach:
Quite Tricky solution, i will explain using the example given in the picture.
Find out all the nodes which are at distance ‘3’ from the given node 5.