码迷,mamicode.com
首页 >  
搜索关键字:k sum    ( 21381个结果
LeetCode: Triangle 题解
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the fol...
分类:其他好文   时间:2014-05-08 21:08:25    阅读次数:407
shell脚本练习题(更新中...)
练习题(这里贴的是自己写的代码, 网上给的题目代码我会附加在最下面)1.编写shell脚本,计算1-100的和; 1 #!/bin/bash 2 #caculate the sum of numbers from 1 to 100 3 4 sum=0 5 for i in `seq 1 100`;....
分类:其他好文   时间:2014-05-07 19:34:54    阅读次数:305
[leetcode] Path sum路径之和
要求给定树,与路径和,判断是否存在从跟到叶子之和为给定值的路径。比如下图中,给定路径之和为22,存在路径,因此返回true;否则返回false. 5 / \ 4 8 / / \ 11...
分类:其他好文   时间:2014-05-07 10:15:46    阅读次数:270
Leetcode | 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-05-07 09:36:09    阅读次数:300
杭电1231
1题目:给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ..., Nj },其中 1 int main(){ int n, a[10001], left, beforeleft, right, i, max, sum; while...
分类:其他好文   时间:2014-05-06 13:18:27    阅读次数:366
554554
$\bf命题1:$$(\bf{Bendixon判别法})$设$\sum\limits_{n = 1}^\infty {{u_n}\left( x \right)} $为$\left[ {a,b} \right]$上的可微函数项级数,且$\sum\limits_{n = 1}^\infty {{u_n...
分类:其他好文   时间:2014-05-04 19:51:10    阅读次数:378
655
$\bf命题2:$设正项级数$\sum\limits_{n = 1}^\infty {{a_n}} $收敛,则存在发散到正无穷大的数列$\left\{ {{b_n}} \right\}$,使得级数$\sum\limits_{n = 1}^\infty {{a_n}{b_n}} $仍收敛证明:令${r...
分类:其他好文   时间:2014-05-04 19:18:36    阅读次数:389
549565
$\bf命题2:$设$f\left( x \right) \in C\left( { - \infty , + \infty } \right)$,令\[{f_n}\left( x \right) = \sum\limits_{k = 0}^{n - 1} {\frac{1}{n}} f\left(...
分类:其他好文   时间:2014-05-04 19:12:48    阅读次数:361
68
$\bf命题1:$设正项级数$\sum\limits_{n = 1}^\infty {{a_n}} $发散,且${s_n} = \sum\limits_{k = 1}^n {{a_k}} $,试讨论级数$\sum\limits_{n = 1}^\infty {\frac{{{a_n}}}{{{s_n...
分类:其他好文   时间:2014-05-04 19:03:33    阅读次数:360
求数组中和为给定值的任意两个数
题目: 输入一个已经按升序排序过的数组和一个数字,在数组中查找两个数,使得它们的和正好是输入的那个数字。要求时间复杂度是O(n)。如果有多对数字的和等于输入的数字,输出任意一对即可。 例如输入数组1、2、4、7、11、15和数字15。由于4+11=15,因此输出4和11。 思路: 最直接的做法是暴力法,两个for循环,时间复杂度为O(n*n),但是这样没有充分利用升序数组这一前提。我们假设数组为A,长度为len,给定的和为sum,最好的方法是先用数组的第一个数A[lo...
分类:其他好文   时间:2014-05-04 17:56:57    阅读次数:596
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!