码迷,mamicode.com
首页 >  
搜索关键字:pathsum    ( 13个结果
LeetCode--Binary Tree Maximum Path Sum
递归,dfs这里返回值是一个pair,first表示两个子树的不经过当前root的最大pathsum;second表示两个子树的,以root->left和root->right为路径起始节点的路径的最大值 1 /** 2 * Definition for binary tree 3 * stru.....
分类:其他好文   时间:2014-09-07 19:43:15    阅读次数:195
LeetCode Minimum Path Sum
class Solution {public: int minPathSum(vector > &grid) { int rows = grid.size(); if (rows pathsum(cols + 1, INT_MAX); pathsum...
分类:其他好文   时间:2014-06-30 13:23:04    阅读次数:153
Leetcode::Pathsum & Pathsum II
PathsumDescription:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equa...
分类:其他好文   时间:2014-06-08 01:11:46    阅读次数:395
13条   上一页 1 2
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!