Program in C++
Condition: Develop a program that reads numbers N, M (1 < N, M < 256) from the keyboard - the number of vertices and edges of the graph; a sequence of M pairs of integers - edges of the graph. The program stores the graph - an adjacency list and performs an algorithm on it - to determine whether the given graph is a tree or a forest.