You are viewing a single comment's thread. Return to all comments →
def getHeight(self,root): left_height = 0 if root.left is None else 1 + self.getHeight(root.left) right_height = 0 if root.right is None else 1 + self.getHeight(root.right) return max(left_height, right_height)
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 →