Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 104. Maximum Depth of Binary Tree
Given the root of a binary tree, return its maximum depth — the number of nodes along the longest root-to-leaf path. This classic easy problem is solved by a DFS or level-order traversal in O(n) time (n ≤ 10^4).
Asked at:
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Mid October, 2024
Junior
Calculate the depth of a binary tree
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.