A rooted tree is a tree with a distinguished root node. When a rooted tree is embedded in a plane, a cyclic ordering is induced on the subtrees of the root. Such trees are called rooted plane trees.
Given a tree $T$, is there an algorithm that can output a rooted plane tree $T_r$ isormorphic to $T$ such that every node $v$ except the root is labelled with a number $f(v)$ so that $v$ is the $f(v)$-th child of its pararent?
What's the complexity?