<｜begin▁of▁sentence｜>### Instruction:
Given a graph with edge set [(0, 1), (1, 2), (2, 3), (3, 4)], how can you determine if it is a tree using NetworkX?
### Response:
import networkx as nx

g = nx.Graph()
g.add_edges_from([(0, 1), (1, 2), (2, 3), (3, 4)])
is_tree = nx.is_tree(g)
print('Is the graph a tree?', is_tree)
<|EOT|>
