Say I have the following map of nodes in a tree and their children:
(def a {0 [], 1 [], 2 [0, 1]})
Corresponding to a tree with node 2 at its root and two leaf-nodes 0 and 1 as node 2's children.
How do I transform it into a map of fathers, or, better yet, adorn it with the fathers. E.g. arrive at the following map of fathers:
{0 2, 1 2, 2 nil} ; each node only has one father at most
Or, better yet, at the following map which combines children and fathers:
{0 [[] 2], 1 [[] 2], 2 [[0,1] nil]}