A graph consists of a set vertices and edges between pairs of vertices. Two vertices are connected if there is a path(subset of edges)leading from one vertex to another, and a connected component is a maximal subset of vertices that are all connected to each other. A graph consists one or more connected components.
A tree is a connected component without cycles, but it can also be characterized in other ways. For example, a tree consisting of n vertices has exactly n-1 edges.Also, there is a unique path connecting any pair of vertices in a tree.
Give a graph, report the number of connected components that are also trees.