For a Given node of a binary tree, print the K distance nodes.
Problem
You are given a function printKDistanceNodes which takes in a root node of a binary tree, a start node and an integer K. Complete the function to print the value of all the nodes (one-per-line) which are a K distance from the given start node in sorted order. Distance can be upwards or downwards.
Example
start node = 18, k = 2 , then output = 2, 19, 25
[Read More]