Last active
September 2, 2025 02:20
-
-
Save AbeEstrada/e38a3f9161c1435ca9ccefe45528d629 to your computer and use it in GitHub Desktop.
Exercise: Height of a Binary Tree
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
| function height(root) { | |
| if (root === null) return -1; | |
| return 1 + Math.max(height(root.left), height(root.right)); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment