I have a list of child-parent tuples. I would like to traverse through the tree to collect all the children for input node.
in_list = [(2,1),(3,2),(4,3),(6,5),(7,4),(8,4)]
Say now I would like to collect all children for node 2. That would be
out_list = [3,4,7,8]
Does this problem or its solution have any specific name? Just need to know where to look.