码迷,mamicode.com
首页 >  
搜索关键字:k sum    ( 21381个结果
Binary Tree Maximum Path Sum
Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 ...
分类:其他好文   时间:2014-07-10 11:24:15    阅读次数:229
计算文件夹大小、拷贝文件显示进度
计算文件夹大小(get-childitem -path $folder -recurse| measure-object -property length -sum).sum/1mb#拷贝文件提示进度(脚本只对零散文件有效,如果有大型文件的话,进度显示不正确)$folder = "D:\Temp_d...
分类:其他好文   时间:2014-07-10 00:34:36    阅读次数:392
[leetcode] Add Binary
Given two binary strings, return their sum (also a binary string).
分类:其他好文   时间:2014-07-09 23:52:48    阅读次数:383
连续子数组的最大和
题目:输入一个整型数组,数组里有正数也有负数。数组中一个或者连续的多个整数组成一个子数组。求所有子数组的和的最大值。要求时间复杂度为O(n)分析:首先需要考虑的条件:数组里有正数也有负数,根据这个条件,从数组第一个元素开始,temp累计相加,当temp增加时,我们就将temp赋值给sum。当temp...
分类:其他好文   时间:2014-07-07 23:22:47    阅读次数:224
Problem Path Sum
Problem Description: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 equ...
分类:其他好文   时间:2014-07-07 19:03:39    阅读次数:165
Leetcode-Two Sum
题目: Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the ta...
分类:其他好文   时间:2014-06-28 08:17:11    阅读次数:305
LeetCode——Path Sum II
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. For example: Given the below binary tree and sum = 22, 5 / ...
分类:其他好文   时间:2014-06-28 07:31:28    阅读次数:214
PIG中的null问题
在比较操作(==,!=,>,=,<=),matches,算数操作(+,-,*,/ ,包含%,?,CASE)中,如果有一个操作数为空,那么结果为空。 COUNT_STAR ,不过滤null数据 CAST 操作:将一个null数据从一个数据类型转换到另一个数据类型,结果为空 AVG,MIN,MAX,SUM,COUNT :这几个操作将忽略空值 CONCAT :任意...
分类:其他好文   时间:2014-06-27 23:24:12    阅读次数:304
[leetcode] Minimum Path Sum
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.
分类:其他好文   时间:2014-06-27 23:02:33    阅读次数:258
一天一道算法题--6.25--无定义
感谢微信平台---一天一道算法题--每天多一点进步----其实今天我接下去补上的几题都来自---待字闺中 所以我就原封不动的将它的题目与分析搬过来了原题给定一个数组,我们可以找到两个不相交的、并且是连续的子数组A和B,A中的数字和为sum(A), B中的元素和为sum(B)。找到这样的A和B,满足s...
分类:其他好文   时间:2014-06-27 22:31:04    阅读次数:342
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!