Algorithm—Determine whether a graph is connected; whether it is a tree; if there is a ring, if there is a ring, print it out