MCPcopy Create free account
hub / github.com/ActiveState/code / isTree

Method isTree

recipes/Python/576912_A_Tree_Finder/recipe-576912.py:92–108  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

90 return True
91
92 def isTree(self):
93 if not self.inv_g.vertices:
94 return True
95 if self.has_duplicate_edges:
96 return False
97
98 isATree = True
99 for v in self.inv_g.vertices:
100 if not self.find_roots(v, {}):
101 isATree = False
102 if not isATree:
103 return False
104
105 if len(self.roots) != 1:
106 return False
107
108 return True
109
110class Reader(object):
111 def __init__(self, fd):

Callers 1

testFunction · 0.95

Calls 1

find_rootsMethod · 0.95

Tested by

no test coverage detected