Created
October 19, 2018 20:03
-
-
Save tech-cow/305a2278f8a4e74ac294eafa4717c35f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def getHeight(root): | |
| if not root: return 0 | |
| left = getHeight(root.left) | |
| right = getHeight(root.right) | |
| return max(left, right) + 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment