Skip to content

[DFS] Binary Tree Maximum Path Sum #33

@sudosf

Description

@sudosf

Problem

Given a binary tree, find the maximum path sum. A path is any sequence of nodes where each pair of adjacent nodes has an edge. The path does not need to pass through the root.

References

Difficulty

🔴 Hard

Companies

Microsoft, Facebook, Morgan Stanley

Notes

Language: Java
Track global max separately. Each recursive call returns max gain from that node going downward (not the split path).

Metadata

Metadata

Assignees

No one assigned

    Labels

    dfsDepth-first searchhardHard difficultytreeTree problems

    Projects

    Status
    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions