Undirected graph is a tree or not

i just wanted to know whether this code is correct or not

yes code is correct

keep learning :smile: