Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution {
- public int maxDepth(TreeNode root) {
- if (root == null) return 0;
- return Math.max(1+maxDepth(root.left), 1+maxDepth(root.right));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement