Skip to content

[DFS] Maximum Depth of Binary Tree #31

@sudosf

Description

@sudosf

Problem

Given the root of a binary tree, return its maximum depth (number of nodes along the longest path from root to a leaf).

References

Difficulty

🟢 Easy

Companies

Flipkart, Paytm, PhonePe

Notes

Language: Java
Baseline DFS on trees. 1 + max(left, right).

Metadata

Metadata

Assignees

No one assigned

    Labels

    dfsDepth-first searcheasyEasy difficultytreeTree problems

    Projects

    Status
    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions