(myTree)
| 12 | arrow_args = dict(arrowstyle="<-") |
| 13 | |
| 14 | def getNumLeafs(myTree): |
| 15 | numLeafs = 0 |
| 16 | firstStr = myTree.keys()[0] |
| 17 | secondDict = myTree[firstStr] |
| 18 | for key in secondDict.keys(): |
| 19 | if type(secondDict[key]).__name__=='dict':#test to see if the nodes are dictonaires, if not they are leaf nodes |
| 20 | numLeafs += getNumLeafs(secondDict[key]) |
| 21 | else: numLeafs +=1 |
| 22 | return numLeafs |
| 23 | |
| 24 | def getTreeDepth(myTree): |
| 25 | maxDepth = 0 |
no outgoing calls
no test coverage detected