Convert a tree with an order to its prüfer code.
Tree requirements:
1
We call filterMinLeaf and get back:
filterMinLeaf
none
If the node has a parent, we add it to the left of the accumulated prüfer code array and recurse again on the now smaller tree.
When a node has no parent, we stop the recursion.
Convert a tree with an order to its prüfer code.
Tree requirements:
1as its root node.We call
filterMinLeafand get back:noneif rootIf the node has a parent, we add it to the left of the accumulated prüfer code array and recurse again on the now smaller tree.
When a node has no parent, we stop the recursion.