Can the same node appear twice in a tree?
A tree is defined to be a set of nodes, with a parent-child relationship that satisfies certain properties.  Thus, it doesn't make sense to ask whether a node can "appear" twice.

In your code snippet, you have constructed a DAG, not a tree.