How to check if a given is undirected graph tree or not? Is there any correlation between the two?
undirected graph
tree
I thought to check if the graph is connected or not? But is that enough?
None for an undirected graph, which must be a tree u, must be checked for 2 conditions.
1) The graph must be connected.
2) There should be no cycle.
DFS / BFS can be used to test both cases.