Cyclic Tree Detection