Skip to content

Instantly share code, notes, and snippets.

@pratyushcrd
Last active January 13, 2018 11:37
Show Gist options
  • Save pratyushcrd/fab68ee1ea381ca4fb8b6c36b6375677 to your computer and use it in GitHub Desktop.
Save pratyushcrd/fab68ee1ea381ca4fb8b6c36b6375677 to your computer and use it in GitHub Desktop.
const height = (node) => node ? Math.max(height(node.left), height(node.right)) + 1 : 0
// That's all folks!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment