First I built the tree using pr eorder and inorder and verified the code at hackerblocks…It is workign fine.
I created one helper function to print all downwards node.
Then I used kthNode function to call for below nodes at a distance k and for ancestors at a distance of k-d-1.
2 test case failing