Undirected graph is a tree or not