You don't need to read input or print anything. Complete the function KDistanceNodes() which takes the root of the tree, target, and K as input parameters and returns a list of nodes at k distance from target in a sorted order.
Expected Time Complexity: O(N*logN) Expected Auxiliary Space: O(Height of tree)
1 ≤ N ≤ 103
1 ≤ data of node ≤ 104
1 ≤ target ≤ 104
1 ≤ k ≤ 20