You are viewing a single comment's thread. Return to all comments →
This is what I came up with:
def getHeight(self,root): if root is None: return -1 else: return max(self.getHeight(root.left),self.getHeight(root.right)) + 1
Seems like cookies are disabled on this browser, please enable them to open this website
Day 22: Binary Search Trees
You are viewing a single comment's thread. Return to all comments →
This is what I came up with: