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
| // Audrey Lee (UNI al3626) Solution | |
| // To be run with TreeNode.java in the same directory | |
| // Precondition: There is a Binary tree | |
| // Postcondition: Depth of the Binary tree | |
| public class Solution { | |
| public static int maxDepth(TreeNode root) { | |
| // Base case: if tree is empty |