Skip to content

Instantly share code, notes, and snippets.

@charlespunk
Created March 12, 2013 21:41
Show Gist options
  • Save charlespunk/5147329 to your computer and use it in GitHub Desktop.
Save charlespunk/5147329 to your computer and use it in GitHub Desktop.
public static int findMaxDepth(Node root){
if(root == null) return -1;
return Math.max(fidMaxDepth(root.left), findMaxDepth(root.right)) + 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment