|All-time Popular Problems|
|Delete without head pointer|
|Check if a number is power of another number|
|Array to BST|
|Implement Queue using Linked List|
|Lowest Common Ancestor in a BST|
|Reverse a Linked List in groups of given size.|
|Print all nodes that don’t have sibling|
|Equal to product|
Given a binary tree, a target node in the binary tree, and an integer value k, print all the nodes that are at distance k from the given target node. No parent pointers are available.
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains an integer n denoting the number of edges. Then the following line contains the edges as given in the example. The next line contains the target node. The last line of input contains the the value of distance k.
Print all the space separated nodes that are at distance k from the given target node.
1<=no of edges<=100
1<=data of node<=100
20 8 L 20 22 R 8 4 L 8 12 R 12 10 L 12 14 R
20 7 L 20 24 R 7 4 L 7 3 R 3 1 L
10 14 22