文件名称:leetcodetreenode-binary-tree-maximum-path-sum:二叉树最大路径和
文件大小:998B
文件格式:ZIP
更新时间:2024-07-21 03:03:22
系统开源
leetcode 树节点二叉树最大路径和 执行 : /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode() {} * TreeNode(int val) { this.val = val; } * TreeNode(int val, TreeNode left, TreeNode right) { * this.val = val; * this.left = left; * this.right = right; * } * } */ class Solution { int max_sum = Integer . MIN_VALUE ; public int max_gain ( TreeNode node ) { if (node == null ) return 0 ; // max sum on the left and right sub-trees of node int lef
【文件预览】:
binary-tree-maximum-path-sum-master
----README.md(1KB)