Generate the Prufer code for a given tree by specifying its nodes and edges.
Extra information about Prufer codes: Wikipedia.