Skip to content

Instantly share code, notes, and snippets.

View audreylee25128's full-sized avatar

Audrey Lee audreylee25128

View GitHub Profile
// 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