testing for trees being acyclic and connected.