Distinguish Between Graph And Tree