You are given a binary tree and a node in the tree, your task is to find all the nodes in the binary tree which are at a distance K from that node. These nodes can be downwards [descendants of the node] or upwards.
For example: In this image
The nodes that are at a distance 2 from 7 are 5 (6’s left child), 11, 5 (2’s right child).
This is a coding question.
void PrintKDistanceNode(Node *root, Node *node, int K)