<｜begin▁of▁sentence｜>### Instruction:
Given two rooted trees T1 with edge set [(0, 1), (1, 2)] and T2 with edge set [(0, 3), (3, 4)], how can you join these trees into a new rooted tree using NetworkX?
### Response:
import networkx as nx

# Assuming we have two rooted trees
T1 = nx.DiGraph()
T1.add_edges_from([(0, 1), (1, 2)])

T2 = nx.DiGraph()
T2.add_edges_from([(0, 3), (3, 4)])

# Create a new rooted tree by joining T1 and T2
T_joined = nx.jointrees(T1, T2, root=0)

# Display the edges of the joined tree
print(list(T_joined.edges()))
<|EOT|>
